summaryrefslogtreecommitdiff
path: root/src/Fl_Gl_Choice.H
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>1999-09-16 05:34:27 +0000
committerBill Spitzak <spitzak@gmail.com>1999-09-16 05:34:27 +0000
commitc8794e2f58b4bd0f6d7324546c7492849065ad66 (patch)
tree55658d20d55cb4dfb16852f38801568037d4e364 /src/Fl_Gl_Choice.H
parent5e57d3cc1267c53692b070bfeea4bdf9951d5256 (diff)
Fixed some WIN32 bugs found in 1.0.5:
FL_MOUSELEAVE had an extra underscore call to toupper() removed const char* cast added to fl_draw_pixmap Change to Fl_Gl_Window that did not get in in time for 1.0.5, it caches the current gl context and does not call glXMakeCurrent (wglMakeCurrent on WIN32) if not needed. This distinctly speeds up Mesa, Irix, and Windows opengl, although I am stumped why such a test is not built into those libraries already. If you use other code that sets the current OpenGL context fltk will get confused because it does not know it changed. To fix such programs you must call fl_no_gl_context() to clear the cache. There is a report that this causes the fractals demo to crash on some Linux and Irix machines, although I can't reproduce it. I suspect the problem is the fractals demo and not fltk, but this change may be making it more likely to fail. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@726 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Gl_Choice.H')
-rw-r--r--src/Fl_Gl_Choice.H20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/Fl_Gl_Choice.H b/src/Fl_Gl_Choice.H
index 34fa3fc07..e49eff019 100644
--- a/src/Fl_Gl_Choice.H
+++ b/src/Fl_Gl_Choice.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Gl_Choice.H,v 1.4 1999/01/07 19:17:20 mike Exp $"
+// "$Id: Fl_Gl_Choice.H,v 1.4.2.1 1999/09/16 05:34:24 bill Exp $"
//
// OpenGL definitions for the Fast Light Tool Kit (FLTK).
//
@@ -68,19 +68,27 @@ public:
Colormap colormap; // a colormap to use
#endif
uchar r,d,o; // rgb mode, double buffered, overlay flags
- // either use mode flags from gl_draw.H or a literal glX int list.
- // one of the two arguments must be zero!
+ // Return one of these structures for a given gl mode.
+ // The second argument is a glX attribute list, and is used if mode is
+ // zero. This is not supported on Win32:
static Fl_Gl_Choice *find(int mode, const int *);
};
-#ifdef WIN32
-// function to create and init the dc needed to draw OpenGL:
+extern GLXContext fl_first_context; // used to make all contexts share
+extern GLXContext fl_current_context;
+
class Fl_Window;
+
+#ifdef WIN32
+// This must be called before fl_set_gl_context works:
HDC fl_private_dc(Fl_Window*, int, Fl_Gl_Choice **gp);
#endif
+void fl_set_gl_context(Fl_Window*, GLXContext);
+void fl_no_gl_context();
+
#endif
//
-// End of "$Id: Fl_Gl_Choice.H,v 1.4 1999/01/07 19:17:20 mike Exp $".
+// End of "$Id: Fl_Gl_Choice.H,v 1.4.2.1 1999/09/16 05:34:24 bill Exp $".
//