summaryrefslogtreecommitdiff
path: root/src/Fl_Gl_Choice.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2015-08-31 16:43:41 +0000
committerManolo Gouy <Manolo>2015-08-31 16:43:41 +0000
commitfeab968e26c0ad014a7b2d7a55653e8dd2dd9f84 (patch)
treeb6365e1e2fbe4e4171cf52f95435937205e5fdc4 /src/Fl_Gl_Choice.cxx
parent529927e0b8b712a4c6fede76dd91c68b8de8d3b4 (diff)
Improved use of the gl_texture_reset() function:
it is necessary only if all GL windows have been deleted. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10848 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Gl_Choice.cxx')
-rw-r--r--src/Fl_Gl_Choice.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Fl_Gl_Choice.cxx b/src/Fl_Gl_Choice.cxx
index e614db01c..edb0843f2 100644
--- a/src/Fl_Gl_Choice.cxx
+++ b/src/Fl_Gl_Choice.cxx
@@ -29,7 +29,9 @@
# ifdef WIN32
void fl_save_dc(HWND, HDC);
-# endif
+#elif defined(__APPLE__)
+extern void gl_texture_reset();
+#endif
static Fl_Gl_Choice *first;
@@ -239,6 +241,9 @@ GLContext fl_create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int lay
GLContext fl_create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int layer) {
GLContext context, shared_ctx = 0;
if (context_list && nContext) shared_ctx = context_list[0];
+ // resets the pile of string textures used to draw strings
+ // necessary before the first context is created
+ if (!shared_ctx) gl_texture_reset();
context = Fl_X::create_GLcontext_for_window(g->pixelformat, shared_ctx, window);
if (!context) return 0;
add_context((GLContext)context);