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.
Note: the syntax of command/switch `sed -i` is slightly different
on macOS vs. Linux and should not be used.
Move .gitignore parts referring to /documentation/ to their own file
'documentation/.gitignore' and add new generated file(s).
Function fl_read_image() obliges to keep a minimal use of global variable fl_window
also under the Wayland platform, even if its type (Window) makes little sense for
the hybrid library because it has its X11 value (given by X11/X.h) which is not
meaningful for the Wayland leg of the hybrid platform.
Virtual member function Fl_Surface_Device::as_image_surface() becomes useless.
The special use context of fl_read_image() inside the draw() function of an
Fl_Double_Window, where the function should read inside the window's double buffer
rather than the on-screen window, no longer worked.
Removal of all uses of the fl_window global variable from platform-independent
code remains necessary, because this variable is ill-defined in the Wayland/X11
library.
1) add Wayland code that prevent subwindows from leaking outside their parent.
This does not cover GL subwindows.
2) add macOS code that prevent GL subwindows from leaking outside their parent.
This fixes issue #494 for the macOS platform.
N.B.: Wayland GL subwindows are not prevented from leaking because no solution
that would not require any change in client applications was found. Code that
would cover Wayland GL subwindows but would require client applications to always
use the FL_ALPHA flag is included in this commit in commented out form.
The old code would allocate memory on FL_KEYDOWN and FL_KEYUP events
and never free the latter.
The fix is to allocate memory only on FL_KEYDOWN events which will
be free'd later as intended.
Also fix two unrelated whitespace errors.
warning: ‘int xrender_supported()’ defined but not used
This happens only with certain configure options, particularly if
FLTK_USE_CAIRO is set, i.e. drawing with Cairo is enabled.