SDL_Render expose by default the same size as the window

This commit is contained in:
Sylvain 2023-01-29 15:39:22 +01:00
parent a67b441a10
commit f0b3078e34
No known key found for this signature in database
GPG key ID: 5F87E02E5BC0939E

View file

@ -1051,6 +1051,11 @@ SDL_CreateRenderer(SDL_Window *window, const char *name, Uint32 flags)
SDL_GetWindowSize(renderer->window, &window_w, &window_h);
renderer->dpi_scale.x = (float)window_w / output_w;
renderer->dpi_scale.y = (float)window_h / output_h;
/* Virtually expose the same size as the window */
if (output_w != window_w || output_h != window_h) {
SDL_SetRenderLogicalSize(renderer, window_w, window_h);
}
}
}