diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-10-15 20:45:58 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-10-15 20:45:58 +0000 |
| commit | 7db8fe569d8598355299e1fbfc0ed6b49924a075 (patch) | |
| tree | 363de0b8328bebe3667764260f1750a5d36c44d2 /src | |
| parent | 1d42e4784b4bbdfa0de16616dac656b58e8c25f0 (diff) | |
Preliminary OpenGL single-buffering fix.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2676 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Gl_Window.cxx | 19 |
1 files changed, 16 insertions, 3 deletions
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 $". // |
