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. --- documentation/src/opengl.dox | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'documentation/src/opengl.dox') diff --git a/documentation/src/opengl.dox b/documentation/src/opengl.dox index 68f5e71aa..d1a36be11 100644 --- a/documentation/src/opengl.dox +++ b/documentation/src/opengl.dox @@ -605,36 +605,6 @@ 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. -
  1. Create a function called, say, add_widgets(), charged of the creation -of all FLTK widgets expected to be drawn above the GL3 scene, as follows -\code -void add_widgets(Fl_Gl_Window *g) { -#ifdef __APPLE__ - g = fl_mac_prepare_add_widgets_to_GL3_win(g); -#endif - g->begin(); - // … Create here FLTK widgets expected to be drawn above the GL3 scene … - g->end(); -} -\endcode -and call this function with the GL3-using window as argument to populate it -with FLTK widgets. -
  2. -Put -\code -#ifndef __APPLE__ - glUseProgram(0); // Switch from GL3-style to GL1-style drawing - Fl_Gl_Window::draw(); // Draw FLTK child widgets. -#endif -\endcode -at the end of your GL3 window's draw() function. This is not necessary if -the GL3 window is built by GLUT, because Fl_Glut_Window::draw() does it. - -
- If GLEW is installed on the Mac OS development platform, it is possible to use the same code for all platforms, with one exception: put \code -- cgit v1.2.3