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

SDL3: The "SDL_VIDEODRIVER" environment variable should be supported as a fallback #11115

Open
DanielGibson opened this issue Oct 7, 2024 · 1 comment · May be fixed by #11120
Open

SDL3: The "SDL_VIDEODRIVER" environment variable should be supported as a fallback #11115

DanielGibson opened this issue Oct 7, 2024 · 1 comment · May be fixed by #11120
Milestone

Comments

@DanielGibson
Copy link
Contributor

DanielGibson commented Oct 7, 2024

Users are trained to use SDL_VIDEODRIVER=wayland for native Wayland support.
Renaming that env var to SDL_VIDEO_DRIVER breaks this.
As SDL3 is ABI-stable now it's probably too late to undo the renaming, but if the SDL_VIDEO_DRIVER env var isn't set it could (should!) still fall back to SDL_VIDEODRIVER.

Probably same for SDL_AUDIODRIVER/SDL_AUDIO_DRIVER.

I briefly looked at the code and am not sure how to best implement this: Hardcode the case in SDL_Get_Hint() and friends (if(result == NULL && strcmp(name, SDL_HINT_VIDEO_DRIVER) == 0) result = SDL_getenv("SDL_VIDEODRIVER");), or somehow handle this in the callers of SDL_GetHint(SDL_VIDEO_DRIVER)?
The latter is probably harder to do correctly if I want to respect hint priorities..

By the way, the (public) Hint API is missing a getter for a hints priority.

@slouken slouken added this to the 3.2.0 milestone Oct 7, 2024
@DanielGibson
Copy link
Contributor Author

Implementation of this: #11120

Not 100% sure if this is the best way to implement this, but I think doing this at all (before the first official) SDL3 release does make a lot of sense, and at least my solution is simple ;)

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 a pull request may close this issue.

2 participants