private void gl_custom_HandleDestroyed(object sender, System.EventArgs e)
 {
     if (m_font_stash != null)
     {
         m_font_stash.Dispose();
         m_font_stash = null;
     }
 }
        private void gl_custom_Load(object sender, EventArgs e)
        {
            m_gl_loaded = true;

            // Initialize FontStash with a 512x512 texture cache
            m_font_stash = new FontStash(512, 512);
            string fonts_folder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Fonts);

            m_font_stash_font_id = m_font_stash.AddFont(System.IO.Path.Combine(fonts_folder, "arial.ttf"));

            UpdateBGColor(editor.m_bg_color);
            UpdateClearColor();
            BuildGridGeometry(editor.m_grid_lines, editor.m_grid_spacing);
            BuildDefaults();
            CreateDefaultLight();
            SetupViewport();
        }