Skip to content

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

@DanielGibson

Description

@DanielGibson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions