summaryrefslogtreecommitdiff
path: root/src/Fl_Gl_Window_Driver.H
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-09-27 14:12:39 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-09-27 14:12:39 +0200
commit59fc60ea4cb8db6ee43a1ac37cd4bbbefcb87faa (patch)
tree072de9da3e8f6c0b69f0872320ff7ad117e6aee9 /src/Fl_Gl_Window_Driver.H
parent2ffd4e4f1af16b17a286ff354603a717f5d828a5 (diff)
Simpler code to support FLTK widgets in macOS OpenGL 3 windows.
Also, the application-level code to add widgets to a GL3 window becomes platform-independent.
Diffstat (limited to 'src/Fl_Gl_Window_Driver.H')
-rw-r--r--src/Fl_Gl_Window_Driver.H9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Fl_Gl_Window_Driver.H b/src/Fl_Gl_Window_Driver.H
index 8f3f6cf29..383b6bf56 100644
--- a/src/Fl_Gl_Window_Driver.H
+++ b/src/Fl_Gl_Window_Driver.H
@@ -25,6 +25,7 @@
#define Fl_Gl_Window_Driver_H
#include <FL/Fl_Gl_Window.H>
+#include <FL/gl.h> // for GLint
class Fl_Gl_Choice;
class Fl_Font_Descriptor;
@@ -33,6 +34,10 @@ class Fl_Font_Descriptor;
platform-specific derived class from this class.
*/
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:
@@ -53,7 +58,7 @@ public:
void* overlay() {return pWindow->overlay;}
void draw_overlay() {pWindow->draw_overlay();}
- Fl_Gl_Window_Driver(Fl_Gl_Window *win) : pWindow(win) {}
+ Fl_Gl_Window_Driver(Fl_Gl_Window *win) : pWindow(win) {current_prog=0;}
virtual ~Fl_Gl_Window_Driver() {}
static Fl_Gl_Window_Driver *newGlWindowDriver(Fl_Gl_Window *w);
static Fl_Gl_Window_Driver *global();
@@ -104,6 +109,8 @@ public:
// true means the platform uses glScissor() to make sure GL subwindows
// don't leak outside their parent window
virtual bool need_scissor() { return false; }
+ virtual void switch_to_GL1();
+ virtual void switch_back();
};
#endif /* Fl_Gl_Window_Driver_H */