Commit Graph

4274 Commits

Author SHA1 Message Date
Camilla Löwy
ffe0795e64 Name parameters for callback function types
Started adding these because of Doxygen warnings but it should have been
done regardless.

(cherry picked from commit 4e557437f2)
2021-08-27 17:20:08 +02:00
Richard Boldiš
1d7339f3fc Win32: Fix invalid preprocessor command 'warning'
The GCCism #warning had snuck into the Win32 platform code.

Merges #1953.

(cherry picked from commit 2ac7e20aaf)
2021-08-27 17:20:00 +02:00
Camilla Löwy
50b09938e7 X11: Fix function returning before cleanup
The _glfwPlatformSetWindowFloating function would return without freeing
the state array if the window was already in the requested state.

(cherry picked from commit 071d7c0f46)
2021-08-27 17:19:46 +02:00
Camilla Löwy
123643df2d Remove unneccessary quotes in CMake conditions
(cherry picked from commit 87d5646f5d)
2021-08-27 17:16:56 +02:00
Camilla Löwy
ab5f006cff Update comment for msvcrt CMake option
(cherry picked from commit 9a0e88a016)
2021-08-27 17:14:15 +02:00
Camilla Löwy
74a8ba26c3 Simplify parsing of default gamepad mappings
The outer glfwUpdateGamepadMappings function is now bypassed when
parsing the default gamepad mappings.  The data in mappings.h does not
contain any comments or line breaks.  Also this is done before joystick
support has been initialized, so there is no need to look for matching
devices.

Finally, the array of default mappings is pre-allocated.  This has no
measurable performance impact but does generate a lot of calls, which
won't be nice for a user provided custom allocator to deal with.

(cherry picked from commit 201400b974)
2021-08-27 17:13:12 +02:00
Camilla Löwy
929286ca47 Update gamepad mappings from upstream
(cherry picked from commit afa78b4270)
2021-08-27 17:13:01 +02:00
Camilla Löwy
d3317b4937 Add gamepad mapping filtering by backend
This fixes gamepad mappings being included in GLFW binaries that would
then never use them because they were for a different platform.

(cherry picked from commit 0c90e1a33f)
2021-08-03 16:01:03 +02:00
Camilla Löwy
b3b82cdd78 Add custom target for updating gamepad mappings
(cherry picked from commit 01778329ec)
2021-08-03 16:00:30 +02:00
Camilla Löwy
20a7962a9b Improve error description for invalid scancodes
(cherry picked from commit 56092814f3)
2021-08-03 15:59:59 +02:00
Camilla Löwy
44ad296813 Expand list of distro derivatives slightly
(cherry picked from commit 3dc7349c35)
2021-08-03 15:59:24 +02:00
Camilla Löwy
1b0eac9c58 Add Fedora package names to compilation guide
(cherry picked from commit 9e1ee3f263)
2021-08-03 15:46:11 +02:00
Camilla Löwy
65c36563f6 Update changelog
Related to #1840.

(cherry picked from commit ab34cc51c6)
2021-08-03 15:43:49 +02:00
Stephen Gowen
1e98fc325d Cocoa: Fix macro redefinition warning
This avoids generating a macro redefinition warning when the
GL_SILENCE_DEPRECATION macro has been defined for the whole of a larger
project.

Closes #1840.

(cherry picked from commit 1d88a2e3d6)
2021-08-03 15:43:16 +02:00
Camilla Löwy
545b6c7970 Cocoa: Fix MoltenVK layer scale out of sync
The contents scale of the hosted CAMetalLayer created for MoltenVK was
updated only after the GLFW content scale and framebuffer size events
were emitted, causing the layer to get out of sync with the monitor the
window was on.

(cherry picked from commit 076bfd55be)
2021-08-03 15:43:03 +02:00
Camilla Löwy
a7202e2341 Cocoa: Remove calls to -update on nil
These calls have no effect unless the context was created with NSGL.

(cherry picked from commit 836e709503)
2021-08-03 15:41:57 +02:00
Camilla Löwy
9a5511b311 Improve library compilation guide somewhat
Related to #1931.

(cherry picked from commit 3b95970482)
2021-08-03 14:31:31 +02:00
Camilla Löwy
a18f4e50b0 Add credit
Related to #1931.

(cherry picked from commit b6f7ead3c5)
2021-08-03 14:04:52 +02:00
David V. McKay
3bf580ad1d realizing "as you would" is platform dependent
specified "for linux or unix" and added a bit about using Visual Studio on Windows.

(cherry picked from commit 1a5e07fd4b)
2021-08-03 14:04:48 +02:00
David V. McKay
014ce9c74f Clarify "as you would" for beginners.
fixes #1088

(cherry picked from commit f010d8b77d)
2021-08-03 14:04:45 +02:00
Camilla Löwy
8f0198e82e Remove errors for gamepad element mismatch
Because there are controllers in the wild using the same hardware ID
despite having different numbers of buttons and axes, an error message
was triggered that was only expected for a corrupted mapping database.

This removes the error for now, in preparation for better error handling
for gamepad mappings overall.

Fixes #1763.

(cherry picked from commit 6876cf8d7e)
2021-08-03 14:04:01 +02:00
A. Tombs
bd346b64d6 Consistent subsections in compile guide
In the compile guide, the "Dependencies for Linux and OSMesa" section
looks to be one level too high in the hierarchy. I've moved it to be in
line with the similarly-named sub-sub-sections.

Closes #1923.

(cherry picked from commit 52d8347d34)
2021-08-03 14:03:20 +02:00
Camilla Löwy
d61f7225d1 Wayland: Fix missing constant on FreeBSD
On FreeBSD O_CLOEXEC is only available when _POSIX_C_SOURCE >= 200809.
O_CLOEXEC is in turn required by the epollshim header.

Issue reported on IRC.

(cherry picked from commit a89fcd20d8)
2021-08-03 14:03:01 +02:00
Camilla Löwy
813edfa494 Wayland: Fix case of epollshim find module name
This fixes a warning during the configuration step of CMake.

(cherry picked from commit 5b73fc8b80)
2021-06-25 00:23:11 +02:00
Camilla Löwy
b1a8bc5d69 Add missing changelog entry
Related to #1843.

(cherry picked from commit 6f7c61c6b3)
2021-06-25 00:23:11 +02:00
Camilla Löwy
e04cd8283e Add notes on getting the HDC of a window on Win32
Related to #1913.

(cherry picked from commit 15e05adf67)
2021-06-25 00:23:11 +02:00
Camilla Löwy
db34aea144 Fix some documentation URLs still using http:
Some URLs in the documentation were overlooked during the switch to
https: for the GLFW website.  This updates those and a few third-party
URLs.

(cherry picked from commit 787295b3af)
2021-06-25 00:23:11 +02:00
Camilla Löwy
6518847f4d Update IRC network to Libera.Chat
The `#glfw` IRC channel is moving to the Libera.Chat network due to the
recent takeover of the Freenode network.

(cherry picked from commit 78380c7761)
2021-06-25 00:23:11 +02:00
Camilla Löwy
5ecf2cbdbf Add 'latest' branch to all CI builds
With 3.4, the tip of the 'latest' branch will be a merge commit for
3.3-stable and the main branch, and not simply a fast-foward to an
already tested commit.

This sets up a tiny additional safety net before that merge.

(cherry picked from commit 3b13228650)
2021-06-25 00:23:10 +02:00
Camilla Löwy
45d1f547cd Move VS 2019 builds from AppVeyor to GH Actions
GitHub runners unfortunately do not come with MinGW or VS 2010
pre-installed, so moving those builds will be more involved.  MinGW-w64
is not a good replacement for MinGW as it is far more complete.

This gives at least some feedback for all supported platforms via the
GitHub Actions system.

(cherry picked from commit 4e788fc6dc)
2021-06-25 00:23:10 +02:00
Camilla Löwy
4e1aeb899c Add CI dependency still needed by stable branch
The main branch no longer needs the extra-cmake-modules package but the
stable branch still does.
2021-06-25 00:22:04 +02:00
Camilla Löwy
8bf39cf1f4 Migrate from Travis CI to GitHub Actions
The old Travis CI .org service has been throttled for a while now and is
said to be shutting down completely next week.

This migrates the Travis CI build jobs to GitHub Actions, with minor
changes.

- The trailing whitespace detection has been removed for now.
- The libegl1-mesa-dev dependency for Wayland has been removed as it
  appears to no longer be necessary for building.

(cherry picked from commit 5a6001a83b)
2021-06-15 18:08:32 +02:00
Camilla Löwy
45336c1104 Fix numeric conversion warnings in example
(cherry picked from commit df15a33e10)
2021-06-15 18:07:46 +02:00
Camilla Löwy
163fa83fac EGL: Fix creation of single-buffered windows
The EGL backend ignored the state of GLFW_DOUBLEBUFFER and always
created a double-buffered EGL window.

This sets the EGL_RENDER_BUFFER attribute at EGL window creation
appropriately.

Fixes #1843.

(cherry picked from commit 114776a246)
2021-06-15 18:07:38 +02:00
Camilla Löwy
6769ffcd0f Move single/double-buffer filtering to backends
There is no need to enumerate framebuffer configs that will just be
filtered out later by the GLFW_DOUBLEBUFFER hard constraint.

(cherry picked from commit fd79b02840)
2021-06-15 18:07:28 +02:00
Camilla Löwy
07c29d1c1c Skip initial buffer swap when single-buffered
This skips the buffer swap after the initial glClear performed during
window creation, if the window is single-buffered.  This call confused
apitrace into thinking the window was double-buffered.

Fixes #1873.

(cherry picked from commit 184377b493)
2021-06-15 18:06:46 +02:00
Camilla Löwy
508e24c01c Add tracking of single-/double-buffering
This adds the state part of 04f21abb52
(Make GLFW_DOUBLEBUFFER a window attribute), but without the associated
API change, because this is needed by later bug fixes that will go into
the stable branch.
2021-06-15 18:04:05 +02:00
Camilla Löwy
e756ae1d85 Make monitor and joystick names static strings
Related to #478.

(cherry picked from commit da236ba807)
2021-06-09 18:37:31 +02:00
Camilla Löwy
020ce99170 Remove claim that EGL is not supported on macOS
(cherry picked from commit a39115a27b)
2021-06-09 18:36:42 +02:00
Camilla Löwy
a149810df9 Clarify documentation for hints
(cherry picked from commit bbbbd3e870)
2021-06-09 18:36:13 +02:00
Camilla Löwy
2a5038e4e9 Fix header version macro descriptions in docs
(cherry picked from commit e17ffcd0db)
2021-06-09 18:33:44 +02:00
Camilla Löwy
728aaccbbb Win32: Always define UNICODE and _UNICODE
(cherry picked from commit 9a3a8bc267)
2021-06-09 18:32:24 +02:00
Camilla Löwy
52b2775c2e Win32: Fix macros being enabled for other backends
_UNICODE should not be defined for other backends even when built on
Windows.

(cherry picked from commit a646f51bca)
2021-06-09 18:32:10 +02:00
Camilla Löwy
30b02dd709 Fix description of video mode ordering in docs
The two final sorting criteria were not included in the documentation.

Fixes #1889.

(cherry picked from commit 0e9ec7788b)
2021-06-09 18:32:05 +02:00
Konstantin Podsvirov
9ef9b1361a Fix hardcoded runtime destination in CMake install
Closes #1883.
Closes #1884.

(cherry picked from commit e3f916808d)
2021-06-09 18:31:56 +02:00
Camilla Löwy
5dd6716ee9 Win32: Fix compilation with standalone LLVM
The /clang: suffix passed to Clang-CL was accidentally also passed to
the regular standalone Clang, which caused compilation to fail.  We now
pass /W3 to Clang-CL, which it interprets as -Wall.

The _CRT_SECURE_NO_WARNINGS macro is now defined for both Clang and
Clang-CL.

The /entry: flag passed to link.exe is now also passed to lld-link,
letting the windows subsystem tests and examples link.

Fixes #1807.
Closes #1824.
Closes #1874.

(cherry picked from commit 061a0263a9)
2021-06-09 18:31:39 +02:00
Camilla Löwy
3cded29c2f Replace GL_ARB_debug_output in comments
(cherry picked from commit 85bce8a8ea)
2021-06-09 18:26:39 +02:00
Camilla Löwy
583dcbcc19 Replace GL_ARB_debug_output in context guide
New code should use GL_KHR_debug instead but it's not as good an example
to use in this case as the symbols it adds has no suffixes.

(cherry picked from commit ec621a00bd)
2021-06-09 18:26:36 +02:00
Camilla Löwy
bcaf8daa72 Fix grammar in MoltenVK support docs
(cherry picked from commit 4c90e21e8f)
2021-06-09 18:25:09 +02:00
Camilla Löwy
658744e222 Update USE_MSVC_RUNTIME_LIBRARY_DLL for CMake 3.15
This makes USE_MSVC_RUNTIME_LIBRARY_DLL update the directory scope
CMAKE_MSVC_RUNTIME_LIBRARY variable instead of CMAKE_C_FLAGS on CMake
3.15 and later.

Solution proposed by @moritz-h.

Fixes #1783.
Closes #1796.

(cherry picked from commit f4a7329604)
2021-06-09 18:24:31 +02:00