From bb39fe8be02bf3a06fe9f26cf01c72904be62b73 Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Fri, 24 Mar 2000 08:55:34 +0000 Subject: [PATCH] Removed more testing code from Fl_Gl_Overlay git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1051 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Gl_Overlay.cxx | 66 ++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/src/Fl_Gl_Overlay.cxx b/src/Fl_Gl_Overlay.cxx index 98d96c446..05cfce859 100644 --- a/src/Fl_Gl_Overlay.cxx +++ b/src/Fl_Gl_Overlay.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Gl_Overlay.cxx,v 1.5.2.5 2000/03/24 08:48:40 bill Exp $" +// "$Id: Fl_Gl_Overlay.cxx,v 1.5.2.6 2000/03/24 08:55:34 bill Exp $" // // OpenGL overlay code for the Fast Light Tool Kit (FLTK). // @@ -103,9 +103,7 @@ int Fl_Gl_Window::can_do_overlay() { #else // WIN32: -static int no_overlay_hardware = 0; int Fl_Gl_Window::can_do_overlay() { - if (no_overlay_hardware) return 0; Fl_Gl_Choice* choice = Fl_Gl_Choice::find(0,0); return (choice && (choice->pfd.bReserved & 15)); } @@ -124,40 +122,38 @@ void Fl_Gl_Window::make_overlay() { if (!overlay) { #if HAVE_GL_OVERLAY #ifdef WIN32 - if (!no_overlay_hardware) { - HDC hdc = fl_private_dc(this, mode_,&g); - GLXContext context = wglCreateLayerContext(hdc, 1); - if (!context) { // no overlay hardware - no_overlay_hardware = 1; + HDC hdc = fl_private_dc(this, mode_,&g); + GLXContext context = wglCreateLayerContext(hdc, 1); + if (!context) { + ; // no overlay hardware + } else { + if (fl_first_context) wglShareLists(fl_first_context, context); + else fl_first_context = context; + overlay = context; + LAYERPLANEDESCRIPTOR pfd; + wglDescribeLayerPlane(hdc, g->pixelformat, 1, sizeof(pfd), &pfd); + if (!pfd.iPixelType) { + ; // full-color overlay } else { - if (fl_first_context) wglShareLists(fl_first_context, context); - else fl_first_context = context; - overlay = context; - LAYERPLANEDESCRIPTOR pfd; - wglDescribeLayerPlane(hdc, g->pixelformat, 1, sizeof(pfd), &pfd); - if (!pfd.iPixelType) { - ; // full-color overlay - } else { - fl_overlay_depth = pfd.cColorBits; // used by gl_color() - if (fl_overlay_depth > 8) fl_overlay_depth = 8; - COLORREF palette[256]; - // copy all colors except #0 into the overlay palette: - for (int i = 0; i < 256; i++) { - uchar r,g,b; Fl::get_color((Fl_Color)i,r,g,b); - palette[i] = RGB(r,g,b); - } - // always provide black & white in the last 2 pixels: - if (fl_overlay_depth < 8) { - palette[(1< 8) fl_overlay_depth = 8; + COLORREF palette[256]; + // copy all colors except #0 into the overlay palette: + for (int i = 0; i < 256; i++) { + uchar r,g,b; Fl::get_color((Fl_Color)i,r,g,b); + palette[i] = RGB(r,g,b); } - valid(0); - return; + // always provide black & white in the last 2 pixels: + if (fl_overlay_depth < 8) { + palette[(1<