From 89f9671b406d1d2ac0377ef90d44ebfa7a92150e Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Sun, 25 Sep 2022 16:39:40 +0200 Subject: Add cross-platform support for adding widgets to an OpenGL3-based Fl_Gl_Window. Under non-macOS platforms, the key is to call glUseProgram(0); after having used OpenGL 3 which allows to then use OpenGL 1 and draw FLTK widgets over the OpenGL3 scene. Under macOS, this is impossible because macOS GL3 contexts are not compatible with GL1. The solution implemented here is to create an additional Fl_Gl_Window placed above and sized as the GL3-based window, to give it a non opaque, GL1-based context, and to put the FLTK widgets in that additional window. --- documentation/src/opengl.dox | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'documentation/src') diff --git a/documentation/src/opengl.dox b/documentation/src/opengl.dox index d1a36be11..68f5e71aa 100644 --- a/documentation/src/opengl.dox +++ b/documentation/src/opengl.dox @@ -605,6 +605,36 @@ to be created among your Fl_Gl_Window-derived classes: \endcode after the first glutCreateWindow() call. +\li If the GL3-using window is intended to contain FLTK widgets laid over +the GL3 scene (see \ref opengl_with_fltk_widgets), extra steps are necessary to make this possible in a +cross-platform way. +