diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2019-06-19 13:11:09 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2019-06-19 13:11:09 +0200 |
| commit | 71f645a6ed0522bc49fe57f8cabf17f2a1e0b29e (patch) | |
| tree | b967edbd22d0f99de294f47a1f3a9011c6681fb2 | |
| parent | 8e6ba19e3ea56150e6d37a9c9394655bb1dec7c9 (diff) | |
Fix building for Windows platform when HAVE_GL_OVERLAY is set to 1
| -rw-r--r-- | src/Fl_Gl_Overlay.cxx | 15 | ||||
| -rw-r--r-- | src/Fl_Gl_Window_Driver.H | 2 |
2 files changed, 12 insertions, 5 deletions
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; } diff --git a/src/Fl_Gl_Window_Driver.H b/src/Fl_Gl_Window_Driver.H index 56dc2a873..9d28c1f22 100644 --- a/src/Fl_Gl_Window_Driver.H +++ b/src/Fl_Gl_Window_Driver.H @@ -136,6 +136,7 @@ class Fl_WinAPI_Gl_Window_Driver : public Fl_Gl_Window_Driver { virtual void invalidate() {} virtual int flush_begin(char& valid_f); virtual void hide_overlay(void *& overlay); + virtual void hide_overlay(); virtual Fl_Gl_Choice *find(int m, const int *alistp); virtual GLContext create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int layer = 0); virtual void set_gl_context(Fl_Window* w, GLContext context); @@ -150,6 +151,7 @@ class Fl_WinAPI_Gl_Window_Driver : public Fl_Gl_Window_Driver { #if HAVE_GL_OVERLAY virtual int can_do_overlay(); virtual int overlay_color(Fl_Color i); + void make_overlay(void*&overlay); #endif }; |
