summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2001-03-14 17:20:02 +0000
committerBill Spitzak <spitzak@gmail.com>2001-03-14 17:20:02 +0000
commit97234fb3e28e7c8eaf844ae0fd841122de2c47dc (patch)
treebd60a8df587b31d829e6c253ae79dc093364668e /test
parent8470c05b5802bddbc6f02769e0d013332bbdf9a4 (diff)
Replaced remaining _WIN32 symbols with WIN32
Stuff from work: Removed reference to unused GL/glu.h header file, which is missing on some Linux systems. Fl_Gl_Window has a new method to allow you to get and set the context: void Fl_Gl_Window::context(void*, int destroy = 0) void* Fl_Gl_Window::context() const; Return or set a pointer to the GLContext that this window is using. This is a system-dependent structure, but it is portable to copy the context from one window to another. You can also set it to NULL, which will force FLTK to recreate the context the next time make_current() is called, this is useful for getting around bugs in OpenGL implementations. If destroy_flag is true the context will be destroyed by fltk when the window is destroyed, or when the mode() is changed, or the next time context(x) is called. Some cleanup of Fl_Gl_Choice to move most of the system dependent #ifdefs into Fl_Gl_Choice.cxx. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1413 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test')
-rw-r--r--test/cube.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/cube.cxx b/test/cube.cxx
index 0236b3ba7..58d9d7579 100644
--- a/test/cube.cxx
+++ b/test/cube.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: cube.cxx,v 1.4.2.4 2001/01/22 15:13:41 easysw Exp $"
+// "$Id: cube.cxx,v 1.4.2.5 2001/03/14 17:20:02 spitzak Exp $"
//
// Another forms test program for the Fast Light Tool Kit (FLTK).
//
@@ -152,6 +152,16 @@ int main(int argc, char **argv) {
form->show(argc,argv);
cube->show();
cube2->show();
+#if 0
+ // This demonstrates how to manipulate OpenGL contexts.
+ // In this case the same context is used by multiple windows (I'm not
+ // sure if this is allowed on Win32, can somebody check?).
+ // This fixes a bug on the XFree86 3.0 OpenGL where only one context
+ // per program seems to work, but there are probably better uses for
+ // this!
+ cube->make_current(); // causes context to be created
+ cube2->context(cube->context()); // share the contexts
+#endif
for (;;) {
if (form->visible() && speed->value())
{if (!Fl::check()) break;} // returns immediately
@@ -169,5 +179,5 @@ int main(int argc, char **argv) {
}
//
-// End of "$Id: cube.cxx,v 1.4.2.4 2001/01/22 15:13:41 easysw Exp $".
+// End of "$Id: cube.cxx,v 1.4.2.5 2001/03/14 17:20:02 spitzak Exp $".
//