Commit Graph

1613 Commits

Author SHA1 Message Date
dcnieho
a5fe10f70c set default FREEGLUT_GLES=ON on android
(cherry picked from commit 0a464e7d6e)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1864 7f0cb862-5218-0410-a997-914c9d46530a
2020-02-26 16:29:10 +00:00
jtsiomb
b9998bbc1e Work-around for an issue which cropped up with the release of gcc-10. In their
infinite wisdom, they decided to build with -fno-common as default from now on,
breaking every piece of C code which used to declare common symbols in header
files, as was the convention since the dawn of time. We now have to duplicate
all declarations to an arbitrary source file, and change the header-file ones
to prefix them with extern.


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1863 7f0cb862-5218-0410-a997-914c9d46530a
2020-02-21 22:25:31 +00:00
dcnieho
67c0f23bdd Omit mention of autoconf update, autoconf is no longer in use
(cherry picked from commit fbbe1295dd)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1861 7f0cb862-5218-0410-a997-914c9d46530a
2019-10-22 08:12:59 +00:00
dcnieho
228ed9638f Use <sys/joystick.h> on netbsd, too.
<machine/joystick.h> is a compatibility header that only includes
<sys/joystick.h>, and wasn't added to newer architectures.

This helps the build on netbsd/aarch64.

(cherry picked from commit bcfbede38a)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1860 7f0cb862-5218-0410-a997-914c9d46530a
2019-10-22 08:12:44 +00:00
jtsiomb
142c7af2e6 updated version number to prepare for release 3.2.1
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1856 7f0cb862-5218-0410-a997-914c9d46530a
2019-09-25 20:43:34 +00:00
jtsiomb
dda17d2506 Fixed bug #252: menu windows are drawn with immediate mode and the fixed
function pipeline, and therefore we must make sure the context created for them
is not a core profile context. Previously if the user requested a core profile
context, this would apply to menu windows too, and they would appear black.



git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1855 7f0cb862-5218-0410-a997-914c9d46530a
2019-09-25 10:08:07 +00:00
jtsiomb
ff0bded3ea fixed bug #251: freeglut cmake modules installation would disregard
CMAKE_INSTALL_LIBDIR



git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1854 7f0cb862-5218-0410-a997-914c9d46530a
2019-09-18 11:58:31 +00:00
jtsiomb
31606f4f88 Fixed failure to install glut.h header file when FREEGLUT_REPLACE_GLUT is
enabled (bug #250)


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1853 7f0cb862-5218-0410-a997-914c9d46530a
2019-09-18 11:53:32 +00:00
jtsiomb
8085e72291 Version bump in cmake, that should have been done for 3.2.0. Changed SO_MINOR
due to introduction of the new ucall entry points



git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1852 7f0cb862-5218-0410-a997-914c9d46530a
2019-09-18 10:45:42 +00:00
jtsiomb
796b7d2f56 A couple of fixes in fg_joystick_x11.c identified in bug report #249
- The correct way to set the O_NONBLOCK flag, is to OR that flag with existing
  flags. Previously we were overriding everything else and setting the flags
  value to O_NONBLOCK directly. Unlikely to cause a problem because we probably
  don't have any other flags in the newly opened file descriptor, but strictly
  spaking it was incorrect.
- If ioctl JSIOCGAXES and JSIOCGBUTTONS could fail, as it stands, it would
  clobber the value of joy->num_axes/joy->num_buttons. It can't fail, but maybe
  in the future who knows. Let's be safe.



git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1848 7f0cb862-5218-0410-a997-914c9d46530a
2019-09-11 13:24:28 +00:00
jtsiomb
2239d6c54d Fixed namespace pollution due to a number of global symbols missing an fg prefix
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1846 7f0cb862-5218-0410-a997-914c9d46530a
2019-08-14 10:33:31 +00:00
jtsiomb
f645974902 Applied Christian's change to drop unnecessary dependency to X11 libraries we
don't actually use, by asking cmake to link with X11_X11_LIB instead of the
catch-all X11_LIBRARIES.


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1845 7f0cb862-5218-0410-a997-914c9d46530a
2019-03-26 18:55:42 +00:00
jtsiomb
4a4f400ca7 Fixed mousewheel callbacks under X11. (bug #247, github issue #66)
The code had the incorrect assumption that button numbers mapped to the wheel
follow after the last "real" button as returned by the GLUT_NUM_MOUSE_BUTTONS
query, which in turn resolves to a call to XGetPointerMapping. In reality the
X server always sends button presses for 4 and 5 when a wheel is turned down/up
respectively, and the rest of the mouse buttons (if any) follow afterwards.
Also XGetPointerMapping doesn't seem to reliably return the number of actual
buttons, and in any case the wheel "buttons" are certainly included in the
count as they can be remapped.
Since we can't know if buttons after 5 are further wheels or regular buttons
this modification only ever invokes the wheel callback for wheel 0.


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1844 7f0cb862-5218-0410-a997-914c9d46530a
2018-10-10 05:23:33 +00:00
jtsiomb
29313e5313 fixed spaceball button callback (x11) compatibility with original GLUT: button
numbers should start from 1, not 0.


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1843 7f0cb862-5218-0410-a997-914c9d46530a
2018-09-29 06:05:26 +00:00
jtsiomb
89c58f2256 - fallback to non-sRGB visuals if the context creation failed (GLX-only)
- added new glutGet query: GLUT_WINDOW_SRGB (untested on windows)


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1842 7f0cb862-5218-0410-a997-914c9d46530a
2018-04-02 03:16:50 +00:00
dcnieho
20e9df4141 variable wasn't declared before rest of function. Thanks Markus Israelsson and Vinnie
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1841 7f0cb862-5218-0410-a997-914c9d46530a
2018-03-27 07:41:18 +00:00
dcnieho
b8a9827c5b cleaning up mixed tabs and spaces
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1840 7f0cb862-5218-0410-a997-914c9d46530a
2018-03-26 20:32:31 +00:00
dcnieho
a2fef0a9bb fix that stereo shutter glasses for nVidia setups did not engage. We lose the ability to have child windows as the WS_POPUP style doesn't play nice with them, but thats a small price to pay as we estimate them to be rare for stereo displays. Thanks Markus Israelsson
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1839 7f0cb862-5218-0410-a997-914c9d46530a
2018-03-26 20:24:31 +00:00
dcnieho
b50503822a Fix build for Android using clang compiler.
(cherry picked from commit 8366af203e)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1838 7f0cb862-5218-0410-a997-914c9d46530a
2018-03-24 08:51:51 +00:00
dcnieho
d1adda4783 clear window workmask when queuing up window for destruction. All callbacks (except destroy) are removed from the window already anyway. This fixes a problem where a newly created window that is immediately destroyed again causes an error-exit because it is still being inited and at that point it is found that no display callback has been set, which is an error.
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1837 7f0cb862-5218-0410-a997-914c9d46530a
2017-10-23 19:01:09 +00:00
dcnieho
173c394399 Little fix'es.
macOS, BlackBerry.

(cherry picked from commit 033e58b75d)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1836 7f0cb862-5218-0410-a997-914c9d46530a
2017-10-23 18:22:43 +00:00
dcnieho
5bcf802a95 Fix build on NetBSD.
(cherry picked from commit 1236c76445)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1835 7f0cb862-5218-0410-a997-914c9d46530a
2017-07-31 20:49:26 +00:00
dcnieho
72e830f256 Fixed freeglut.pdb install for builds with MSVC compiler and NMake.
The CMake variable "MSVC" indicates that the Visual Studio compiler is
used but  when using that compiler and the "NMake Makefiles JOM" build
generator the *.pdb is wasn't output in a "Debug" directory.

(cherry picked from commit 4e6bceed00)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1834 7f0cb862-5218-0410-a997-914c9d46530a
2017-07-31 20:49:16 +00:00
dcnieho
5442c0abbf Fixed warnings on Linux where GCC under padantic complained ISO C casting wasn't legal
(cherry picked from commit 13ed05fe8d)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1833 7f0cb862-5218-0410-a997-914c9d46530a
2017-07-21 15:13:44 +00:00
dcnieho
eaabcd6b52 moved static variables and functions that should not have stuck behind in fg_joystick.c, but should have been in fg_joystick_x11.c
(cherry picked from commit 0d98472817)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1832 7f0cb862-5218-0410-a997-914c9d46530a
2017-07-12 20:45:07 +00:00
dcnieho
07297565c8 some whitespace cleanup
(cherry picked from commit 2dd5aa4aa1)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1830 7f0cb862-5218-0410-a997-914c9d46530a
2017-07-12 20:44:47 +00:00
dcnieho
b39b3a5edf Fix build on NetBSD.
(cherry picked from commit 06e1d815cf9abda49b845754ff420734446eb95b)

(cherry picked from commit c4294ad590)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1829 7f0cb862-5218-0410-a997-914c9d46530a
2017-07-12 20:44:35 +00:00
dcnieho
3e8f42bbff Do not define HAVE_USBHID_H manually, cmake does it for us.
(cherry picked from commit 78b19bfc9709d5c4175a7866059a42c478272071)

(cherry picked from commit 0b64b227b5)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1828 7f0cb862-5218-0410-a997-914c9d46530a
2017-07-12 20:44:28 +00:00
dcnieho
fbd61be1dd Fixed incorrect MESSAGE usage
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1827 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:23:11 +00:00
dcnieho
5df98e73df CMake produces an error if XInput.h is not found
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1826 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:23:05 +00:00
dcnieho
47fb7d5f28 Removed "hack" macro set
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1825 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:22:59 +00:00
dcnieho
1fec35a406 Corrected phrasing in docs and unneeded \ in code
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1824 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:22:52 +00:00
dcnieho
cc6830131a Fixed x11 and Wayland not using INVOKE_WCB
...since INVOKE_WCB handled user data. Now they handle user data.

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1823 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:22:45 +00:00
dcnieho
850d80554a Added timer_callback sample for user callbacks
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1822 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:22:39 +00:00
dcnieho
deaa5b843a Added "hack" function for glutCreateMenuUcall
Not desired, but potentially needed as with the other "hack" functions

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1821 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:22:26 +00:00
dcnieho
2646c0c9f8 Moved as many callback setters as possible to macro function generators
Moved macro function generators to fg_callback_macros.h

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1820 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:22:19 +00:00
dcnieho
9f0eaf1a92 Fixed bug where, under c89 mode, callback macros wouldn't work
Under c89 (only applies to GCC-like compilers), the variadic macro version would be used and compilation would fail.

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1818 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:22:06 +00:00
dcnieho
8ac335fa7f Removed unneeded line optimization for INVOKE_WCB macro
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1817 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:21:59 +00:00
dcnieho
da3e00905e Fixed issue where setting the same callback with different user pointer wouldn't change the user pointer.
Removed extra comment on FETCH_USER_DATA_WCB
Renamed helper callbacks from glutXXXCalback to fghXXXCallback

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1816 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:21:53 +00:00
dcnieho
16d920d56a Added compiler feature detection for __VA_ARGS__ and GCC ##__VA_ARGS__
Made macro names more explicit to prevent name conflicts

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1815 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:21:46 +00:00
dcnieho
dbbf2e5f08 Implemented pre-C99 support for macro expansion for callbacks.
Note: not tested with a pre-C99 compiler as I (the author) don't have any compiler that doesn't C99.

Fixed copyright too.

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1814 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:21:40 +00:00
dcnieho
0209cd1ef5 Bug fix for GCC compiler usage
Removed old/original GCC implementation of EXPAND_WCB

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1813 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:21:34 +00:00
dcnieho
658edf902d Initial refactoring of callback macros to make sure all compilers are supported
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1812 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:21:28 +00:00
dcnieho
f0150de08d More explicit argument list for INVOKE_WCB callbacks
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1811 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:21:21 +00:00
dcnieho
da0b7b3369 Changed EXPAND_WCB so it works with MSVC and GCC
- Required adding an "argument expansion macro" for each callback (hope to remove eventually)
- Fixed MSVC linking error where glutMenuStatusFuncUCall had the incorrect case and should've been glutMenuStatusFuncUcall
- Updated formatting of some freeglut_ext.h functions

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1810 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:21:14 +00:00
dcnieho
827f593d96 Finished implementing all user-data callbacks (GCC-only for now).
Updated glutCreateMenu, glutIdleFunc, and glutTimerFunc so they handle NULL callback cases.
Removed glutMenuStateFuncUcall (as glutMenuStateFunc is a depreciated function).

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1809 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:21:06 +00:00
dcnieho
3c3e3cd234 Initial work on callbacks with user data parameters.
-glutCreateMenuUcall
-glutTimerFuncUcall
-glutIdleFuncUcall

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1808 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-30 23:20:57 +00:00
dcnieho
75854e0698 multi-touch demo: if an index 64 would come in, this would be written in the wrong place in the cursor buffer. Supporting 64 IDs means writing to slots 0--63
(cherry picked from commit bef94a71b1)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1806 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-14 20:51:20 +00:00
dcnieho
caa5ffe29a resizer demo: adding a bit more output to console to indicate what is going on upon keypress
(cherry picked from commit f04be0c4f2)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1805 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-14 20:51:14 +00:00
dcnieho
26a9d9ca03 multi-touch callback had a copy paste error in the draw loop (thanks sorav for reporting)
(cherry picked from commit a40f9e9c4e)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1804 7f0cb862-5218-0410-a997-914c9d46530a
2017-06-14 20:51:09 +00:00