summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES4
-rw-r--r--FL/Enumerations.H7
-rw-r--r--src/Fl_Gl_Window.cxx19
3 files changed, 24 insertions, 6 deletions
diff --git a/CHANGES b/CHANGES
index 4c8da1102..056a2e930 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
CHANGES IN FLTK 1.1.1
+ - Some OpenGL implementations don't support single-
+ buffered visuals. The Fl_Gl_Window class now emulates
+ single-buffered windows using double-buffered
+ windows.
- Added a workaround for a compiler bug in Borland C++
that prevented Fl_Help_View.cxx from compiling.
- Checkmarks didn't scale properly; copied the 2.0 check
diff --git a/FL/Enumerations.H b/FL/Enumerations.H
index 588ceb13b..cfbba55fc 100644
--- a/FL/Enumerations.H
+++ b/FL/Enumerations.H
@@ -1,5 +1,5 @@
//
-// "$Id: Enumerations.H,v 1.18.2.14.2.26 2002/10/07 13:47:54 easysw Exp $"
+// "$Id: Enumerations.H,v 1.18.2.14.2.27 2002/10/15 20:45:58 easysw Exp $"
//
// Enumerations for the Fast Light Tool Kit (FLTK).
//
@@ -381,7 +381,8 @@ enum Fl_Mode { // visual types and Fl_Gl_Window::mode() (values match Glut)
FL_STENCIL = 32,
FL_RGB8 = 64,
FL_MULTISAMPLE= 128,
- FL_STEREO = 256
+ FL_STEREO = 256,
+ FL_FAKE_SINGLE = 512 // Fake single buffered windows using double-buffer
};
// damage masks
@@ -405,5 +406,5 @@ enum Fl_Damage {
#endif
//
-// End of "$Id: Enumerations.H,v 1.18.2.14.2.26 2002/10/07 13:47:54 easysw Exp $".
+// End of "$Id: Enumerations.H,v 1.18.2.14.2.27 2002/10/15 20:45:58 easysw Exp $".
//
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx
index 914eceb55..043588aa5 100644
--- a/src/Fl_Gl_Window.cxx
+++ b/src/Fl_Gl_Window.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.12 2002/08/09 03:17:30 easysw Exp $"
+// "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.13 2002/10/15 20:45:58 easysw Exp $"
//
// OpenGL window code for the Fast Light Tool Kit (FLTK).
//
@@ -65,7 +65,16 @@ void Fl_Gl_Window::show() {
if (!shown()) {
if (!g) {
g = Fl_Gl_Choice::find(mode_,alist);
- if (!g) {Fl::error("Insufficient GL support"); return;}
+
+ if (!g && (mode_ & FL_DOUBLE) == FL_SINGLE) {
+ g = Fl_Gl_Choice::find(mode_ | FL_DOUBLE,alist);
+ if (g) mode_ |= FL_FAKE_SINGLE;
+ }
+
+ if (!g) {
+ Fl::error("Insufficient GL support");
+ return;
+ }
}
#if !defined(WIN32) && !defined(__APPLE__)
Fl_X::make_xid(this, g->vis, g->colormap);
@@ -128,6 +137,10 @@ void Fl_Gl_Window::make_current() {
RealizePalette(fl_gc);
}
#endif // USE_COLORMAP
+ if (mode_ & FL_FAKE_SINGLE) {
+ glDrawBuffer(GL_FRONT);
+ glReadBuffer(GL_FRONT);
+ }
current_ = this;
}
@@ -367,5 +380,5 @@ void Fl_Gl_Window::draw_overlay() {}
#endif
//
-// End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.12 2002/08/09 03:17:30 easysw Exp $".
+// End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.13 2002/10/15 20:45:58 easysw Exp $".
//