Commit Graph

21 Commits

Author SHA1 Message Date
Albrecht Schlosser bc63ea7629 CMake: improve linking OpenGL3 example programs (#959)
- Remove find_library(LIB_GLEW ...) from 'resources.cmake'

- Use the variable FLTK_GLEW_DIR to "find" a user supplied GLEW library
  for OpenGL3 example programs (examples/OpenGL3*.cxx).
  Both static and shared libs (DLLs) are supported, but the static
  library is preferred to avoid DLL dependencies.

- Define preprocessor macro 'GLEW_STATIC' by CMake compile definitions
  if and only if the static glew library (glew32s) was found and linked.
  The previous code defined 'GLEW_STATIC' unconditionally in the source
  code which led to undefined references if a shared lib (DLL) was used.
2024-05-13 15:19:27 +02:00
Albrecht Schlosser 38e1d6b099 Fix Visual Studio compiler warnings, make output visible...
on Windows w/o a console device ("DOS"/Debug window) if OpenGL3 is
not available.
2024-05-05 19:33:28 +02:00
Matthias Melcher 44c874b731
Use `FL_OVERRIDE` for all overridden virtual methods (#611)
FL_OVERRIDE is defined as `override` for C++11 and higher
FL_OVERRIDE is defined as `override` for VisualC 2015 and newer
Don't interfere with Fl_Widget::override()
2022-12-30 19:14:36 +01:00
Albrecht Schlosser c570bd8f96 Fix trailing whitespace 2022-11-01 20:06:22 +01:00
ManoloFLTK 6732044a07 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 ~ .
2022-10-06 08:43:09 +02:00
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
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 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 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
ManoloFLTK 6b63516890 Wayland: fix error detection during call to glewInit(). 2022-09-22 08:07:46 +02:00
ManoloFLTK 3718effc43 Add the Wayland platform to FLTK 1.4 2022-03-04 15:41:00 +01:00
Albrecht Schlosser f09e17c3c5 Remove $Id$ tags, update URL's, and more
- remove obsolete svn '$Id$' tags from all source files
- update .fl files and generated files accordingly
- replace 'http://www.fltk.org' URL's with 'https://...'
- replace bug report URL 'str.php' with 'bugs.php'
- remove trailing whitespace
- fix other whitespace errors flagged by Git
- add and/or fix missing or wrong standard headers
- convert tabs to spaces in all source files

The only relevant code changes are in the fluid/ folder where
some .fl files and other source files were used to generate
the '$Id' headers and footers.
2020-07-06 20:28:20 +02:00
ManoloFLTK 9b7f020ed3 Update procedure for OpenGL3 support. 2019-04-04 18:42:45 +02:00
Albrecht Schlosser 52ae3582a2 Replace "WIN32" with "_WIN32" or "Windows".
Replace compiler/preprocessor/platform macro "WIN32" with "_WIN32".
Replace "WIN32" in text and documentation with "Windows".
Replace "MSWindows" with "Windows".

To do: README.Windows.txt (and maybe other documentation as well)
needs updates.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12655 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-09 14:39:42 +00:00
Albrecht Schlosser 42d8aba117 Replace FL/x.H with FL/platform.H - step 2 (STR #3435).
This second step replaces FL/x.H with FL/platform.H in all source files.
Dependencies have been adjusted as well.

This commit completes the replacement of FL/x.H with FL/platform.H.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12641 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-31 21:17:17 +00:00
Manolo Gouy 22596d3f5f Make Fl_Gl_Window::pixels_per_unit() return a float (rather than int) value.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11794 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-06-22 07:45:53 +00:00
Manolo Gouy 3e8556195b Added required header and footer for new source files.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10955 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-10 16:20:37 +00:00
Manolo Gouy 22af09dae7 Mac OS: support for high resolution OpenGL windows.
Methods Fl::event_x_pixel() and Fl::event_y_pixel() committed at r.10941
are removed. Instead method Fl_Gl_Window::pixels_per_unit() is added.

The documentation explains in more detail how to write cross-platform
FLTK code supporting high resolution OpenGL windows on retina displays.

The examples/OpenGL3test.cxx app exercises Fl_Gl_Window::pixels_per_unit().

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10945 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-02 09:59:37 +00:00
Manolo Gouy 597ac17bda Mac OS: added Fl::event_x_pixel() and Fl::event_y_pixel() that return the mouse event position
in pixel units that differ from FLTK units for OpenGL windows mapped to a retina display.
On non Mac OS platforms, these are synonyms of Fl::event_x() and Fl::event_y().
The example/OpenGL3test demo program is modified to call these new functions.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10941 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-01 16:17:37 +00:00
Manolo Gouy 7e025aac22 Added support for OpenGL V3 and higher.
On the X11/MSWindows platforms, this requires external installation of the GLEW library.
This fixes STR#3198 and STR#3257.
Added two new examples programs.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10876 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-10-27 08:40:56 +00:00