Running SDL 2.38.2 in Windows 11, with SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl"); everything works fine, but if I also define the environment variable SDL_VIDEODRIVER=opengl it crashes inside SDL_Init():
The video driver isn’t the same thing as the renderer driver (the “video” driver is what backend SDL uses to create the window etc). On Windows, the only available video driver is “windows”.
However, it being set to something else should cause SDL_Init() to fail and return an error instead of crashing outright. You should file a bug report.
OK, but it seems ‘unhelpful’ to have an environment variable which cannot be used to change anything (in Windows at least) but no environment variable to control something that can be changed, i.e. the render driver!
Thanks, that information is quite well hidden! I tried SDL_RENDERDRIVER without success, I wouldn’t have guessed that it needed an extra underscore when SDL_VIDEODRIVER doesn’t.