diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-09-27 14:12:39 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-09-27 14:12:39 +0200 |
| commit | 59fc60ea4cb8db6ee43a1ac37cd4bbbefcb87faa (patch) | |
| tree | 072de9da3e8f6c0b69f0872320ff7ad117e6aee9 /src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H | |
| parent | 2ffd4e4f1af16b17a286ff354603a717f5d828a5 (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/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H')
| -rw-r--r-- | src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H b/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H index 1f0332103..e1a8dabb3 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H +++ b/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H @@ -20,10 +20,17 @@ #include "../../Fl_Gl_Window_Driver.H" class Fl_Gl_Choice; +#ifdef __OBJC__ + @class NSOpenGLContext; +#else + class NSOpenGLContext; +#endif class Fl_Cocoa_Gl_Window_Driver : public Fl_Gl_Window_Driver { + NSOpenGLContext *gl1ctxt; // GL1 context in addition to GL3 context friend Fl_Gl_Window_Driver* Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *); - Fl_Cocoa_Gl_Window_Driver(Fl_Gl_Window *win) : Fl_Gl_Window_Driver(win) {} + Fl_Cocoa_Gl_Window_Driver(Fl_Gl_Window *win); + ~Fl_Cocoa_Gl_Window_Driver(); virtual float pixels_per_unit(); virtual void before_show(int& need_after); virtual void after_show(); @@ -44,6 +51,8 @@ class Fl_Cocoa_Gl_Window_Driver : public Fl_Gl_Window_Driver { virtual bool need_scissor() { return true; } virtual void* GetProcAddress(const char *procName); void apply_scissor(); + virtual void switch_to_GL1(); + virtual void switch_back(); }; |
