mirror of
https://github.com/fltk/fltk.git
synced 2026-06-01 23:06:54 +08:00
Fix building for Windows platform when HAVE_GL_OVERLAY is set to 1
This commit is contained in:
+10
-5
@@ -233,10 +233,14 @@ void Fl_WinAPI_Gl_Window_Driver::hide_overlay(void *& overlay) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Fl_WinAPI_Gl_Window_Driver::hide_overlay() {
|
||||||
|
Fl_Gl_Window_Driver::hide_overlay();
|
||||||
|
}
|
||||||
|
|
||||||
void Fl_WinAPI_Gl_Window_Driver::make_overlay_current() {
|
void Fl_WinAPI_Gl_Window_Driver::make_overlay_current() {
|
||||||
#if HAVE_GL_OVERLAY
|
#if HAVE_GL_OVERLAY
|
||||||
if (overlay != this) {
|
if (overlay() != this) {
|
||||||
pGlWindowDriver->set_gl_context(this, (GLContext)overlay);
|
set_gl_context(pWindow, (GLContext)overlay());
|
||||||
// if (fl_overlay_depth)
|
// if (fl_overlay_depth)
|
||||||
// wglRealizeLayerPalette(Fl_X::i(this)->private_dc, 1, TRUE);
|
// wglRealizeLayerPalette(Fl_X::i(this)->private_dc, 1, TRUE);
|
||||||
} else
|
} else
|
||||||
@@ -249,6 +253,7 @@ void Fl_WinAPI_Gl_Window_Driver::redraw_overlay() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_GL_OVERLAY
|
#if HAVE_GL_OVERLAY
|
||||||
|
# include "Fl_Gl_Choice.H"
|
||||||
|
|
||||||
//static COLORREF *palette;
|
//static COLORREF *palette;
|
||||||
extern int fl_overlay_depth;
|
extern int fl_overlay_depth;
|
||||||
@@ -256,13 +261,13 @@ extern int fl_overlay_depth;
|
|||||||
void Fl_WinAPI_Gl_Window_Driver::make_overlay(void*&overlay) {
|
void Fl_WinAPI_Gl_Window_Driver::make_overlay(void*&overlay) {
|
||||||
if (overlay) return;
|
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
|
if (!context) {overlay = pWindow; return;} // fake the overlay
|
||||||
|
|
||||||
HDC hdc = Fl_WinAPI_Window_Driver::driver(pWindow)->private_dc;
|
HDC hdc = Fl_WinAPI_Window_Driver::driver(pWindow)->private_dc;
|
||||||
overlay = context;
|
overlay = context;
|
||||||
LAYERPLANEDESCRIPTOR pfd;
|
LAYERPLANEDESCRIPTOR pfd;
|
||||||
wglDescribeLayerPlane(hdc, g->pixelformat, 1, sizeof(pfd), &pfd);
|
wglDescribeLayerPlane(hdc, g()->pixelformat, 1, sizeof(pfd), &pfd);
|
||||||
if (!pfd.iPixelType) {
|
if (!pfd.iPixelType) {
|
||||||
; // full-color overlay
|
; // full-color overlay
|
||||||
} else {
|
} else {
|
||||||
@@ -284,7 +289,7 @@ void Fl_WinAPI_Gl_Window_Driver::make_overlay(void*&overlay) {
|
|||||||
wglSetLayerPaletteEntries(hdc, 1, 1, n, palette+1);
|
wglSetLayerPaletteEntries(hdc, 1, 1, n, palette+1);
|
||||||
wglRealizeLayerPalette(hdc, 1, TRUE);
|
wglRealizeLayerPalette(hdc, 1, TRUE);
|
||||||
}
|
}
|
||||||
valid(0);
|
pWindow->valid(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ class Fl_WinAPI_Gl_Window_Driver : public Fl_Gl_Window_Driver {
|
|||||||
virtual void invalidate() {}
|
virtual void invalidate() {}
|
||||||
virtual int flush_begin(char& valid_f);
|
virtual int flush_begin(char& valid_f);
|
||||||
virtual void hide_overlay(void *& overlay);
|
virtual void hide_overlay(void *& overlay);
|
||||||
|
virtual void hide_overlay();
|
||||||
virtual Fl_Gl_Choice *find(int m, const int *alistp);
|
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 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);
|
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
|
#if HAVE_GL_OVERLAY
|
||||||
virtual int can_do_overlay();
|
virtual int can_do_overlay();
|
||||||
virtual int overlay_color(Fl_Color i);
|
virtual int overlay_color(Fl_Color i);
|
||||||
|
void make_overlay(void*&overlay);
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user