From 2a75e82e3df5ac792a8d2e780e4374463bcf654c Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sun, 28 Mar 2010 06:58:39 +0000 Subject: [PATCH] Fl_Gl_Device_Plugin: better code for GL window capture after coverage by print dialog windows git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7348 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Gl_Device_Plugin.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Fl_Gl_Device_Plugin.cxx b/src/Fl_Gl_Device_Plugin.cxx index 53fc5afad..f8e1e1021 100644 --- a/src/Fl_Gl_Device_Plugin.cxx +++ b/src/Fl_Gl_Device_Plugin.cxx @@ -58,13 +58,15 @@ static void print_gl_window(Fl_Abstract_Printer *printer, Fl_Gl_Window *glw, int Fl_Window *win = (Fl_Window*)glw; while( win->window() ) win = win->window(); win->redraw(); -#else - glw->redraw(); -#endif Fl::check(); glw->make_current(); - // select front buffer as our source for pixel data - glReadBuffer(GL_FRONT); +#else + glw->make_current(); + glw->redraw(); + glFlush(); + Fl::check(); + glFinish(); +#endif // Read OpenGL context pixels directly. // For extra safety, save & restore OpenGL states that are changed glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);