Commit Graph

9895 Commits

Author SHA1 Message Date
ManoloFLTK da66e21e1d Support of FLTK widgets in OpenGL 3 windows - cont'd.
This commit allows to switch between FL_DOUBLE / FL_SINGLE modes
in widget-containing GL3 windows.
Demo program examples/OpenGL3test is modified to show FLTK widgets
even if the platform does not support OpenGL 3.
2022-09-29 09:39:21 +02:00
Albrecht Schlosser 283184a09a Add GitHub Issue Templates
- bug_report.md: template for bug reports
- feature_request.md: template for feature requests
- fltk-build-or-usage-question.md: not really a template [1]

[1] Explain to users that this is the wrong place to ask user
    questions and refer them to fltk.general
2022-09-28 17:18:03 +02:00
ManoloFLTK c2efb0d849 macOS: support of FLTK widgets in OpenGL 3 windows - cont'd.
This code is OK under macOS 10 9 and 13.
2022-09-28 17:06:00 +02:00
ManoloFLTK 7d58e23854 macOS: add necessary setWantsBestResolutionOpenGLSurface:YES message. 2022-09-28 08:23:36 +02:00
ManoloFLTK 3225afaeec Remove use of class Fl_Window_Driver inside libfltk_gl 2022-09-27 16:51:35 +02:00
ManoloFLTK 3ba09047e2 Use PR #507 by @ggarra13 to fix issue #85. 2022-09-27 14:48:22 +02:00
ManoloFLTK 59fc60ea4c 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.
2022-09-27 14:12:39 +02:00
ManoloFLTK 2ffd4e4f1a Replace all calls to sprintf() by calls to snprintf(). 2022-09-26 16:12:18 +02:00
ManoloFLTK 53d9614adb Fix crash under macOS 13 Ventura public beta 6 when closing menu window.
Bizarrely, an NSMouseEntered event arrives returning nil to [event window]!
2022-09-26 10:46:50 +02:00
ManoloFLTK 89f9671b40 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.
2022-09-25 16:39:40 +02:00
Greg Ercolano 0fd10e9fde Updated fltk logo for docs and help_dialog using logo from the website. 2022-09-23 12:46:35 -07:00
ManoloFLTK bfba62a8a2 GL3 for macOS platform: allow creation of GL1 and GL3 contexts by an app. 2022-09-23 18:21:29 +02:00
ManoloFLTK 0fdc88d2d7 GL3 support under X11: ask for compatibility profile if possible. 2022-09-23 18:09:40 +02:00
Albrecht Schlosser 6472f9b041 Fix build process of PDF docs on macOS and update .gitignore
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).
2022-09-23 15:45:45 +02:00
ManoloFLTK eb0bba4058 Fix Fl_X11_Window_Driver::fullscreen_on() and Fl_X11_Window_Driver::fullscreen_off(). 2022-09-23 14:25:32 +02:00
Gonzalo Garramuño f8058aae52 Fixes incorrect install of fluid in macOS Applications directory.
This requires sudo permissions to do it, and breaks ExtenalProject_Add.
2022-09-23 11:29:55 +02:00
ManoloFLTK 9c0c04c50d Use adequate #include for fl_wl_display(). 2022-09-23 08:46:26 +02:00
ManoloFLTK 4b6468a80c Wayland: process OPTION_USE_WAYLAND for Unix only 2022-09-23 07:42:04 +02:00
ManoloFLTK 8bbedd65a8 Fix issue #501: build error under macOS 10.10 2022-09-22 20:12:40 +02:00
ManoloFLTK 647b0a8008 Wayland: fix window closing with titlelbar close button. 2022-09-22 10:51:46 +02:00
ManoloFLTK 6b63516890 Wayland: fix error detection during call to glewInit(). 2022-09-22 08:07:46 +02:00
ManoloFLTK debbba19ec Improve docs of Fl_Copy_Surface and use of OpenGL 3. 2022-09-21 15:15:55 +02:00
ManoloFLTK 75dd467dc5 Update with changes from source (commit bcb1d791) - cont'd. 2022-09-21 15:11:10 +02:00
ManoloFLTK a2bf4d7ef2 Update with changes from source (commit bcb1d791). 2022-09-21 14:52:53 +02:00
ManoloFLTK add3f0566c Add Doxygen description of FL_FREE_COLOR. 2022-09-18 11:57:15 +02:00
ManoloFLTK 09334c51c7 Improve use of CMake's OPTION_BUILD_HTML_DOCUMENTATION 2022-09-17 09:56:45 +02:00
ManoloFLTK eb314f5653 Allow use of Fl_Window::default_icon() with a scaled image - Part 2.
Default icons are handled according to their scaled size, if there scaled.
2022-09-17 09:03:34 +02:00
ManoloFLTK 166a5bf785 Update from libdecor source code (commit a735d056). 2022-09-16 17:26:00 +02:00
ManoloFLTK 699cca8ff4 Make Fl::set_color(r,g,b,a) effective under Wayland and macOS. 2022-09-15 15:01:12 +02:00
ManoloFLTK 700fb1aadd Improve virtual void* Fl_Gl_Window_Driver::GetProcAddress(procName) 2022-09-14 08:53:45 +02:00
ManoloFLTK f265ca2afc Avoid deprecated glGetString(GL_EXTENSIONS) call when possible. 2022-09-13 18:41:18 +02:00
ManoloFLTK e43c2f566d Remove forgotten debug code. 2022-09-13 11:24:08 +02:00
ManoloFLTK 87ee126e1f Allow use of Fl_Window::default_icon() with a scaled image. 2022-09-12 11:07:03 +02:00
ManoloFLTK d028f0b37d Fix fl_read_image() under hybrid Wayland/X11 platform.
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.
2022-09-11 19:45:48 +02:00
ManoloFLTK 98d8a5da0c Fix support of CMake OPTION_WAYLAND_ONLY. 2022-09-11 10:42:56 +02:00
ManoloFLTK ef243d6c86 Add needed variable for Wayland-only platform. 2022-09-11 09:52:02 +02:00
ManoloFLTK 2ea85ea6d7 Fix regression in fl_read_image() after introduction of hybrid Wayland/X11 platform.
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.
2022-09-11 09:15:42 +02:00
ManoloFLTK b37576aa55 New configure setting "--enable-wayland --disable-x11" to build pure Wayland platform. 2022-09-10 07:44:23 +02:00
ManoloFLTK 203e7b7098 New OPTION_WAYLAND_ONLY for CMake to build pure Wayland platform. 2022-09-09 15:19:15 +02:00
ManoloFLTK 1b0f21cc8f Wayland: support going from borderless to bordered window. 2022-09-09 08:23:09 +02:00
ManoloFLTK 7800c2f3c3 Wayland: fix handling of fast calls to Fl_Window::flush().
Also fix scaling of borderless windows.
2022-09-09 07:26:19 +02:00
ManoloFLTK 0ff31668a1 Wayland: remove memory leak from missing wl_callback_destroy() call.
This hopefully corresponds to the memory leak mentioned in fltk.general
named "FLTK and Wayland".
2022-09-08 16:11:53 +02:00
ManoloFLTK 71069b8570 Add necessary virtual qualifier to ~Fl_Font_Descriptor() and derived. 2022-09-08 16:04:09 +02:00
ManoloFLTK 13e05f4204 Improve support of child windows that may leak outside their parent window.
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.
2022-09-07 14:40:16 +02:00
Albrecht Schlosser deeb977c2e Wayland: fix memory leak on FL_KEYUP events
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.
2022-09-06 20:04:33 +02:00
ManoloFLTK 57e0cdec08 Fix for issue #493 2022-09-03 12:36:50 +02:00
ManoloFLTK 21864cf499 Attempt to fix issue #485. 2022-09-03 09:35:48 +02:00
Albrecht Schlosser 76858fc040 Fix compiler warning [-Wunused-function]
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.
2022-09-02 16:28:53 +02:00
ManoloFLTK 16f660f676 Wayland: fix issue #492 - mark FLTK differences. 2022-09-02 09:44:43 +02:00
ManoloFLTK 2a3b4e1f2d Wayland: fix issue #492 "Use after free()". 2022-09-02 09:35:44 +02:00