-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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, macOS: SDL_HINT_RENDER_DRIVER fallback does not work #11077
Comments
Oh, the documentation is wrong here. I'll fix that. It's intentional that it returns NULL if the preferred renderer isn't available, so that the application can try several, in order of preference. |
I am not sure this makes sense. If I want to explicitly create a metal renderer I just call
Why should someone call
instead? I think if the hint works this way it is pretty much useless. |
Because you can do this: renderer = SDL_CreateRenderer("gpu");
if (!renderer) {
renderer = SDL_CreateRenderer("opengles2");
}
if (!renderer) {
renderer = "SDL_CreateRenderer("direct3d");
} |
Exactly, so why would I need that hint? |
Oh, you're right, I was conflating the two. Mmmm, I will reopen this for further thought. |
Isn't a hint useful for a user to try another renderer backend (through an environment variable), and the |
I think this hint would make sense if someone has one single preferred renderer but does not want things to fail if that one is not available. I think if someone wants to make his own order of preference with multiple renderers this would be appropriate:
|
Yep, that's what we do for video drivers, etc. I'll take a look. |
(Just making a note that what we need to do here is make sure SDL_HINT_RENDER_DRIVER takes a comma-separated list, to match what audio and video subsystems already do.) |
I know that 3.2.0 should be released really soon, but I think this shoud be fixed before release. People might use this hint to set a specific renderer instead of using SDL_CreateRenderer() for that. Changing the hint to be treated as prefered renderer could then break someone's code. |
I snuck this in for 3.2.0. The documentation in the original comment was updated at some point to reflect reality, but this now accepts a comma-separated list (both in SDL_CreateRenderer's |
Fantastic! Thank you very much! |
I tried setting SDL_HINT_RENDER_DRIVER to "direct3d" on macOS just to see if it will fall back to the default renderer. Unfortunately this seems to not work as described in the documentation:
I get this error when calling
SDL_CreateRenderer()
:The text was updated successfully, but these errors were encountered: