From 6732044a0789d45b5daa5a376474ca832db44ddb Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Thu, 6 Oct 2022 08:43:09 +0200 Subject: Fix use of several FLTK widgets above an GL scene. The code failed with 2 or more widgets when FLTK would trigger partial redraws of the widgets, unless the Fl_Gl_Window was FL_DAMAGE_ALL. This commit also adds a second FLTK widget to example/OpenGL3test to check this multiple widget situation, and fixes an error where operator ! was used instead of ~ . --- src/Fl_Gl_Window.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx index 4bd4397e1..ae1e66bd6 100644 --- a/src/Fl_Gl_Window.cxx +++ b/src/Fl_Gl_Window.cxx @@ -344,6 +344,7 @@ void Fl_Gl_Window::draw_overlay() {} */ void Fl_Gl_Window::draw_begin() { if (mode() & FL_OPENGL3) pGlWindowDriver->switch_to_GL1(); + damage(FL_DAMAGE_ALL); // always redraw all GL widgets above the GL scene 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(); -- cgit v1.2.3