-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update GLFW to 3.4 #3827
Update GLFW to 3.4 #3827
Conversation
Thanks for starting this update! It was in my TODO list! But note it requires testing on Windows, Linux and macOS. |
Might need to revert #2883 since glfw/glfw@2c3eb75 removed the dependency on wayland-protocols. |
@planetis-m Reverting #2883 is not necessary, as 260a039 contains the necessary changes. |
The new GLFW version supports platform detection at runtime, which enables a single executable to run on both X11 and Wayland. However, it looks like raylib cannot offer the same platform detection functionality at the moment if build with the Makefile (instead of CMake) because some of GLFW's local (static) functions in different platforms have the same name. As a result, we cannot combine source files from multiple platforms into one, as done in Alternatively, we might get rid of It seems to work fine when raylib is build with CMake, however. |
@M374LX I just updated GLFW to 3.4 in raylib Go bindings. I did rename some functions in gen2brain/raylib-go@8596a5d though. I know this will affect a few more projects, like go-gl/glfw#393, so I hope it will be solved, but for now, it is not a big deal, at least for me. There are also changes for Wayland generated headers, they are renamed, and there are some additions, I use a script for that gen2brain/raylib-go@5abcc8b. Now the single binary runs on both X11 and Wayland, you can check the output:
It would be nice to check |
This is a big change, it needs some careful review... but it will be merged. |
05ba358 implements @gen2brain's suggestion to output the platform selected by GLFW to TRACELOG. @gen2brain I suggest also renaming the conflicting functions on the "null" platform, as it is expected by GLFW 3.4 to be present and this is actually a (hopefully temporary) hack: Lines 74 to 79 in 05ba358
Also note that GLFW uses the Zlib license, which states "Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software". Related GLFW issue: glfw/glfw#2502 As the above issue is unlikely to be fixed in a short period of time, I think getting rid of |
@M374LX @gen2brain Changes look good to me for now, please, let me know when you think this PR is ready for merge. Some point to consider:
|
The gamepad mappings are supposed to be the ones provided by GLFW. I am able to test this PR on Linux and can confirm that it works on both X11 and Wayland (despite #3827 (comment)), but I prefer to leave the tests on Windows, macOS and Web for someone with access to these systems and Emscripten set up. Otherwise, I think it is ready to be merged. |
@M374LX Thank you very much for this improvement! |
As the title suggests, this PR updates GLFW to version 3.4.
It seems to work on Linux with both X11 and Wayland (tested on Weston), but we cannot use GLFW's new runtime platform detection at the moment when building raylib with the Makefile instead of CMake, as explained in #3827 (comment). Maybe we can merge the PR as is and check this issue at a different moment.
As for testing on other platforms, I would like to ask for help from other users, although all checks from GitHub Actions are successful as of 6a58cbb.
Update:
It looks like gamepads have stopped working(actually, only one of the gamepads I tested has stopped working, which is probably a rare case and we don't need to care).