From 1367048df23b745328883279e59cb09ab2695d3a Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 16 Oct 2018 09:27:36 +0000 Subject: 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 --- src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'src/drivers/OpenGL') diff --git a/src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx b/src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx index 66570ae41..f574c671c 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx @@ -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 -- cgit v1.2.3