From 59fc60ea4cb8db6ee43a1ac37cd4bbbefcb87faa Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Tue, 27 Sep 2022 14:12:39 +0200 Subject: 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. --- src/Fl_Gl_Window.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Fl_Gl_Window.cxx') 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. -- cgit v1.2.3