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/Fl_Gl_Window.cxx | |
| 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/Fl_Gl_Window.cxx')
| -rw-r--r-- | src/Fl_Gl_Window.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx index 7784af9cb..b6c8f0135 100644 --- a/src/Fl_Gl_Window.cxx +++ b/src/Fl_Gl_Window.cxx @@ -262,6 +262,7 @@ void Fl_Gl_Window::resize(int X,int Y,int W,int H) { if (is_a_resize) valid(0); pGlWindowDriver->resize(is_a_resize, W, H); Fl_Window::resize(X,Y,W,H); + //pGlWindowDriver->resize(is_a_resize, W, H);//essai } /** @@ -343,6 +344,7 @@ void Fl_Gl_Window::draw_overlay() {} \see \ref opengl_with_fltk_widgets */ void Fl_Gl_Window::draw_begin() { + if (mode() & FL_OPENGL3) pGlWindowDriver->switch_to_GL1(); Fl_Surface_Device::push_current( Fl_OpenGL_Display_Device::display_device() ); Fl_OpenGL_Graphics_Driver *drv = (Fl_OpenGL_Graphics_Driver*)Fl_Surface_Device::surface()->driver(); drv->pixels_per_unit_ = pixels_per_unit(); @@ -391,6 +393,7 @@ void Fl_Gl_Window::draw_end() { glPopAttrib(); // GL_ENABLE_BIT Fl_Surface_Device::pop_current(); + if (mode() & FL_OPENGL3) pGlWindowDriver->switch_back(); } /** Draws the Fl_Gl_Window. |
