From 71f645a6ed0522bc49fe57f8cabf17f2a1e0b29e Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Wed, 19 Jun 2019 13:11:09 +0200 Subject: Fix building for Windows platform when HAVE_GL_OVERLAY is set to 1 --- src/Fl_Gl_Overlay.cxx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/Fl_Gl_Overlay.cxx') diff --git a/src/Fl_Gl_Overlay.cxx b/src/Fl_Gl_Overlay.cxx index 13cbfbac6..c10b6f068 100644 --- a/src/Fl_Gl_Overlay.cxx +++ b/src/Fl_Gl_Overlay.cxx @@ -233,10 +233,14 @@ void Fl_WinAPI_Gl_Window_Driver::hide_overlay(void *& overlay) { #endif } +void Fl_WinAPI_Gl_Window_Driver::hide_overlay() { + Fl_Gl_Window_Driver::hide_overlay(); +} + void Fl_WinAPI_Gl_Window_Driver::make_overlay_current() { #if HAVE_GL_OVERLAY - if (overlay != this) { - pGlWindowDriver->set_gl_context(this, (GLContext)overlay); + if (overlay() != this) { + set_gl_context(pWindow, (GLContext)overlay()); // if (fl_overlay_depth) // wglRealizeLayerPalette(Fl_X::i(this)->private_dc, 1, TRUE); } else @@ -249,6 +253,7 @@ void Fl_WinAPI_Gl_Window_Driver::redraw_overlay() { } #if HAVE_GL_OVERLAY +# include "Fl_Gl_Choice.H" //static COLORREF *palette; extern int fl_overlay_depth; @@ -256,13 +261,13 @@ extern int fl_overlay_depth; void Fl_WinAPI_Gl_Window_Driver::make_overlay(void*&overlay) { if (overlay) return; - GLContext context = create_gl_context(pWindow, g, 1); + GLContext context = create_gl_context(pWindow, g(), 1); if (!context) {overlay = pWindow; return;} // fake the overlay HDC hdc = Fl_WinAPI_Window_Driver::driver(pWindow)->private_dc; overlay = context; LAYERPLANEDESCRIPTOR pfd; - wglDescribeLayerPlane(hdc, g->pixelformat, 1, sizeof(pfd), &pfd); + wglDescribeLayerPlane(hdc, g()->pixelformat, 1, sizeof(pfd), &pfd); if (!pfd.iPixelType) { ; // full-color overlay } else { @@ -284,7 +289,7 @@ void Fl_WinAPI_Gl_Window_Driver::make_overlay(void*&overlay) { wglSetLayerPaletteEntries(hdc, 1, 1, n, palette+1); wglRealizeLayerPalette(hdc, 1, TRUE); } - valid(0); + pWindow->valid(0); return; } -- cgit v1.2.3