MacOS: simpler implementation of extra code necessary at first display of layer-backed GL windows

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@13122 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2018-11-16 08:56:48 +00:00
parent 9dfa8a92a9
commit 93f4f91429
2 changed files with 8 additions and 16 deletions

View File

@ -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$".
//

View File

@ -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);