Example #1
0
        private void Clear()
        {
            try {
                if (Font != null)
                {
                    Font.Dispose();
                    Font = null;
                }

                GL.BindTexture(TextureTarget.Texture2D, 0);

                if (GlyphCount > 0)
                {
                    if (m_ListBase > 0)
                    {
                        GL.DeleteLists(m_ListBase, GlyphCount);
                    }
                    else if (!CharMap.IsNullOrEmpty())
                    {
                        CharMap.Values.Select(val => val.ListID).ForEach(lid => GL.DeleteLists(lid, 1));
                        CharMap.Clear();
                    }
                }
                if (!m_Textures.IsNullOrEmpty())
                {
                    GL.DeleteTextures(m_Textures.Length, m_Textures);
                }
            } catch (Exception ex) {
                ex.LogError();
            } finally {
                GlyphCount           = 0;
                m_ListBase           = 0;
                m_Textures           = null;
                Height               = 0;
                Count                = 0;
                m_EllipsisGlyphIndex = GlyphInfo.Empty;
            }
        }