Repository navigation
Accept GLEW_ERROR_NO_GLX_DISPLAY from glewInit() in scenes 2 to 4 - #60
Merged
Merged
Conversation
GLEW built for GLX, as most Linux distributions ship it (Arch's 2.3.1), loads every GL function on an EGL context too, which is what SDL creates on Wayland, and then returns GLEW_ERROR_NO_GLX_DISPLAY because there is no GLX display. Scenes 2 to 4 took that for a failure and exited with "glewInit failed", so they only ran through XWayland. Scene 1 ignores what glewInit() returns and ran either way. Accept that error, and print the error string for any other. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
|
also thanks for the score sheet lmao I'm building a leaderboard |
deadbeef7
marked this pull request as ready for review
November 10, 2026 17:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Linux under Wayland, scenes 2 to 4 (
--scene-only,--pool-only,--pole-only) exit right after the window opens:Scene 1 (
--og-only) runs. WithoutSDL_VIDEODRIVERthe program takes X11 through XWayland and works. Without aDISPLAYit does not start at all, because SDL 2 (sdl2-compat) tries X11 first.Why
Most Linux distributions build GLEW for GLX. Arch's GLEW 2.3.1 is one of them. On Wayland, SDL creates an EGL context.
glewInit()loads every GL function through it, then looks for a GLX display. There isn't one, so it returnsGLEW_ERROR_NO_GLX_DISPLAY, even though nothing is missing.Scene 1 ignores the return value, so it runs. Scenes 2 to 4 check it and exit.
The change
Scenes 2 to 4 now accept
GLEW_ERROR_NO_GLX_DISPLAY. For any other error they printglewGetErrorString()'s text and exit as before:GLEW_ERROR_NO_GLX_DISPLAYhas been inglew.hsince GLEW 2.0. A GLEW built for EGL returnsGLEW_OKhere, so it isn't affected, and neither is Windows.Tested
Tested on Arch Linux with GLEW 2.3.1 and sdl2-compat 2.32.74, on Wayland under Hyprland 0.57 and a fork of it. Each scene ran with
SDL_VIDEODRIVER=waylandand no XWayland involved, then printed its results.--windowed)On an Intel GM45, which has no OpenGL 3.3, scene 4 still exits cleanly with the existing "no OpenGL 3.3 core context" message. Scene 1 runs there as before.
One more thing, not part of this change:
--scene-only,--pool-onlyand--pole-onlyreport any start-up failure as "no OpenGL 3.3 core context on this device". On a machine with no display connected, the real error was SDL's "The video driver did not add any displays".🤖 Generated with Claude Code