diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx index 4ffa19467..b645b8997 100644 --- a/src/Fl_Gl_Window.cxx +++ b/src/Fl_Gl_Window.cxx @@ -297,6 +297,14 @@ void Fl_Gl_Window::flush() { #if HAVE_GL_OVERLAY && defined(WIN32) uchar save_valid_f = valid_f_; #endif + +#ifdef __APPLE__ + Fl_X *i = Fl_X::i(this); + if (i->wait_for_expose) { + Fl_X::GLcontext_update((GLContext)context()); + i->wait_for_expose = 0; + } +#endif #if HAVE_GL_OVERLAY && defined(WIN32) @@ -550,15 +558,6 @@ int Fl_Gl_Window::gl_plugin_linkage() { return fl_gl_load_plugin; } -#ifdef __APPLE__ -extern "C" { - void *fl_mac_gl_window_context(Fl_Gl_Window *); -} -void *fl_mac_gl_window_context(Fl_Gl_Window *glwin) { - return glwin->context(); -} -#endif - // // End of "$Id$". // diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 7e3b41660..1617be591 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -2372,13 +2372,6 @@ static CGContextRef prepare_bitmap_for_layer(int w, int h ) { if (i->wait_for_expose) { // 1st drawing of GL window [self did_view_resolution_change]; - typedef NSOpenGLContext* (*ftype)(Fl_Gl_Window*); - static ftype f = (ftype)dlsym(RTLD_SELF, "fl_mac_gl_window_context"); - if (f) { // that function is implemented in Fl_Gl_Window.cxx from libftk_gl - NSOpenGLContext *ctxt = f(window->as_gl_window()); - [ctxt update]; // GL window may be empty without this - } - i->wait_for_expose = 0; } through_drawRect = YES; window->clear_damage(FL_DAMAGE_ALL);