summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-10-06 08:43:09 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-10-06 08:43:09 +0200
commit6732044a0789d45b5daa5a376474ca832db44ddb (patch)
tree711b92e446a0e85ecaa9f4d73127de0cbbb967ee /src
parent206d9b17e0e2c2a66c3352787b067ab172dad778 (diff)
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 ~ .
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Gl_Window.cxx1
1 files changed, 1 insertions, 0 deletions
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();