Skip to content
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

Fix GLFW runtime platform detection #3863

Merged
merged 9 commits into from
Mar 14, 2024
Merged

Conversation

M374LX
Copy link
Contributor

@M374LX M374LX commented Mar 9, 2024

Fixes #3850

In order to allow all of GLFW's source files to be combined into one, as done by rglfw.c, this PR modifies the bundled GLFW by renaming the functions that share the same name in different platforms. Additionally, it disables GLFW's Null platform, which is not used by raylib.

It also removes the USE_WAYLAND_DISPLAY variable from the Makefile while adding GLFW_LINUX_ENABLE_WAYLAND and GLFW_LINUX_ENABLE_X11, both set to TRUE by default.

@orcmid
Copy link
Contributor

orcmid commented Mar 9, 2024

It is my impression that src/external/ materials are not maintained on raylib and any changes must come from the origin project of the external dependency.

If there is to be an exception to that, I trust you confirmed that before all of the work you did.

@M374LX
Copy link
Contributor Author

M374LX commented Mar 9, 2024

@orcmid If GLFW's developers agree to avoid functions with the same name in different platforms in a future version of the library, there will be no more need for it to be modified for raylib (related: glfw/glfw#2502 and glfw/glfw#2462).

@orcmid
Copy link
Contributor

orcmid commented Mar 10, 2024

@orcmid If GLFW's developers agree to avoid functions with the same name in different platforms in a future version of the library, there will be no more need for it to be modified for raylib

@M374LX I think it is a policy for raylib that externals are not to be customized and then have to be maintained here as a fork. I don't know what @raysan5 will say about this particular complicated case.

Do you see an alternative approach that would overcome the difficulty for raylib without touching src/external?

@raysan5
Copy link
Owner

raysan5 commented Mar 10, 2024

@M374LX @orcmid I try to avoid customizing external libraries for raylib but unfortunately it was also done in the past with other external libraries (sinfl, jar_mod, jar_xm, vox_loader). I think this is a quite special case and considering that GLFW is bundled into raylib and a related issue has already been opened in GLFW repos, I can consider merging it.

Just waiting a bit for GLFW response on the topic. The only issue I see is the need to review it again after next GLFW release, but it can take some time.

@raysan5 raysan5 merged commit 9a8d73e into raysan5:master Mar 14, 2024
13 checks passed
@raysan5
Copy link
Owner

raysan5 commented Mar 14, 2024

@M374LX thanks for the improvements!

@ProIcons
Copy link
Contributor

This breaks the zig build on linux.

ProIcons added a commit to ProIcons/raylib that referenced this pull request Mar 29, 2024
raysan5 pushed a commit that referenced this pull request Mar 30, 2024
* Fixes zig build that was broken on #3863

* Make this work with wayland
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[build] Cannot use GLFW runtime platform detection
4 participants