mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 08:56:25 +00:00
render: Default to primary display in SDL_CalculateSimulatedVSyncInterval if window is not set
- Fixes previous change to SDL_CreateRendererWithProperties which skipped SDL_CalculateSimulatedVSyncInterval if window was not set.
This commit is contained in:
@@ -1015,7 +1015,7 @@ static SDL_RenderLineMethod SDL_GetRenderLineMethod(void)
|
|||||||
|
|
||||||
static void SDL_CalculateSimulatedVSyncInterval(SDL_Renderer *renderer, SDL_Window *window)
|
static void SDL_CalculateSimulatedVSyncInterval(SDL_Renderer *renderer, SDL_Window *window)
|
||||||
{
|
{
|
||||||
SDL_DisplayID displayID = SDL_GetDisplayForWindow(window);
|
SDL_DisplayID displayID = window ? SDL_GetDisplayForWindow(window) : 0;
|
||||||
const SDL_DisplayMode *mode;
|
const SDL_DisplayMode *mode;
|
||||||
int refresh_num, refresh_den;
|
int refresh_num, refresh_den;
|
||||||
|
|
||||||
@@ -1232,9 +1232,7 @@ SDL_Renderer *SDL_CreateRendererWithProperties(SDL_PropertiesID props)
|
|||||||
SDL_SetRenderVSync(renderer, vsync);
|
SDL_SetRenderVSync(renderer, vsync);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (window) {
|
|
||||||
SDL_CalculateSimulatedVSyncInterval(renderer, window);
|
SDL_CalculateSimulatedVSyncInterval(renderer, window);
|
||||||
}
|
|
||||||
|
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_RENDER,
|
SDL_LogInfo(SDL_LOG_CATEGORY_RENDER,
|
||||||
"Created renderer: %s", renderer->name);
|
"Created renderer: %s", renderer->name);
|
||||||
|
Reference in New Issue
Block a user