summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2010-03-17 20:47:47 +0000
committerManolo Gouy <Manolo>2010-03-17 20:47:47 +0000
commitcfe5cfdac3ee86437aec2e6f0be47d6b60ba28b1 (patch)
tree1b8930c5c5ae82321daf345e7b64df0a06414455
parent26af092532e817163d82cd2d0210ec1ca2296e56 (diff)
Added trick to force loading of Fl_Gl_Device_Plugin whenever fltk_gl is loaded.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7290 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl_Gl_Device_Plugin.cxx12
-rw-r--r--src/Fl_Gl_Window.cxx4
2 files changed, 15 insertions, 1 deletions
diff --git a/src/Fl_Gl_Device_Plugin.cxx b/src/Fl_Gl_Device_Plugin.cxx
index 23cd84470..86ea7f0f1 100644
--- a/src/Fl_Gl_Device_Plugin.cxx
+++ b/src/Fl_Gl_Device_Plugin.cxx
@@ -29,8 +29,15 @@ static void print_gl_window(Fl_Virtual_Printer *printer, Fl_Gl_Window *glw, int
_XGC *save_gc = fl_gc;
const int bytesperpixel = 3;
#endif
- glw->redraw();
fl_gc = NULL;
+#ifdef WIN32
+ Fl::check();
+ 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
@@ -109,3 +116,6 @@ public:
static Fl_Gl_Device_Plugin Gl_Device_Plugin;
+// The purpose of this variable, used in Fl_Gl_Window.cxx, is only to force this file to be loaded
+// whenever Fl_Gl_Window.cxx is loaded, that is, whenever fltk_gl is.
+FL_EXPORT int fl_gl_load_plugin = 0;
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx
index b5b052075..805e8271d 100644
--- a/src/Fl_Gl_Window.cxx
+++ b/src/Fl_Gl_Window.cxx
@@ -28,6 +28,10 @@
#include "flstring.h"
#if HAVE_GL
+extern int fl_gl_load_plugin;
+
+static int temp = fl_gl_load_plugin;
+
#include <FL/Fl.H>
#include <FL/x.H>
#include "Fl_Gl_Choice.H"