Skip to content

Commit

Permalink
Fix Fl_OpenGL_Display_Device::capture_gl_rectangle(Fl_Gl_Window*) by …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Manolo Gouy authored and Manolo Gouy committed Oct 16, 2018
1 parent f58c1d8 commit 1367048
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx
Expand Up @@ -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
Expand Down

0 comments on commit 1367048

Please sign in to comment.