Support of FLTK widgets in OpenGL 3 windows under Windows.

This commit is contained in:
ManoloFLTK 2022-09-30 15:53:05 +02:00
parent 75016cb853
commit 4f6965d39f
2 changed files with 11 additions and 3 deletions

View File

@ -32,6 +32,17 @@
// from glew.h in Windows, glext.h in Unix, not used by FLTK's macOS platform
# define GL_CURRENT_PROGRAM 0x8B8D
#endif
// TODO: remove that from this platform-independent source file
#ifdef _WIN32
# include <windows.h> // for WINAPI
#else
# define WINAPI
#endif
typedef void (WINAPI *glUseProgram_type)(GLint);
static glUseProgram_type glUseProgram_f = NULL;
GLContext *Fl_Gl_Window_Driver::context_list = 0;
int Fl_Gl_Window_Driver::nContext = 0;
static int NContext = 0;
@ -60,7 +71,6 @@ void Fl_Gl_Window_Driver::del_context(GLContext ctx) {
if (!nContext) gl_remove_displaylist_fonts();
}
Fl_Gl_Window_Driver::glUseProgram_type Fl_Gl_Window_Driver::glUseProgram_f = NULL;
void Fl_Gl_Window_Driver::switch_to_GL1() {
if (!glUseProgram_f) {

View File

@ -36,8 +36,6 @@ class Fl_Font_Descriptor;
class Fl_Gl_Window_Driver {
private:
GLint current_prog;
typedef void (*glUseProgram_type)(GLint);
static glUseProgram_type glUseProgram_f;
protected:
Fl_Gl_Window *pWindow;
public: