Fix Fl_OpenGL_Display_Device::capture_gl_rectangle(Fl_Gl_Window*) by making current the window's GL context.

The problem was visible with test/cube: when the window was minimized, only the left GL subwindow
was captured in the window icon.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13066 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2018-10-16 09:27:36 +00:00
parent f58c1d85b8
commit 1367048df2

View File

@ -69,6 +69,7 @@ Fl_RGB_Image* Fl_OpenGL_Display_Device::capture_gl_rectangle(Fl_Gl_Window* glw,
w *= factor; h *= factor; x *= factor; y *= factor;
}
Fl_Cocoa_Gl_Window_Driver *driver = (Fl_Cocoa_Gl_Window_Driver*)glw->gl_driver();
driver->GLcontext_makecurrent(glw->context());
driver->flush_context(); // to capture also the overlay and for directGL demo
// Read OpenGL context pixels directly.
// For extra safety, save & restore OpenGL states that are changed