summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Fl_Gl_Choice.cxx7
-rw-r--r--src/Fl_Gl_Window.cxx8
2 files changed, 6 insertions, 9 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);
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx
index 66c718171..ad83c6c13 100644
--- a/src/Fl_Gl_Window.cxx
+++ b/src/Fl_Gl_Window.cxx
@@ -20,9 +20,6 @@
#if HAVE_GL
extern int fl_gl_load_plugin;
-#ifdef __APPLE__
-extern void gl_texture_reset();
-#endif
#include <FL/Fl.H>
#include <FL/x.H>
@@ -189,11 +186,6 @@ void Fl_Gl_Window::make_current() {
context_ = fl_create_gl_context(this, g);
valid(0);
context_valid(0);
-#ifdef __APPLE__
- // resets the pile of string textures used to draw strings
- // necessary when the context is renewed
- gl_texture_reset();
-#endif
}
fl_set_gl_context(this, context_);