SDL_CreateRenderer driver selection priority and fallback limits
0 reputation · 31 Mar 2023, 01:04 UTC
Driver Selection Logic
When calling SDL_CreateRenderer with the driver index set to -1, SDL selects a renderer based on SDL_HINT_RENDER_DRIVER, the provided SDL_RendererFlags, and the drivers compiled into the library. While SDL_RENDERER_ACCELERATED and SDL_RENDERER_SOFTWARE allow for specific requirements, the internal priority list used for automatic selection is not explicitly defined in the public API.
Behavioral Uncertainty
On platforms where multiple hardware-accelerated drivers are available (such as OpenGL and Direct3D on Windows), the selection order may vary depending on the build configuration or platform version. Because SDL_GetRendererInfo only reports the final selection rather than the evaluation process, it is difficult to predict which driver will be chosen when no hint is provided.
- Does SDL prioritize drivers based on a fixed internal list or platform-specific heuristics?
- If
SDL_RENDERER_ACCELERATEDis requested but multiple drivers qualify, what determines the final selection?