Handle DPI scaling in SDL_GetWindowSurface

Fixes DPI awareness of testdrawchessboard (previously, the surface was
being created in points instead of pixels, resulting in the demo app
only drawing in a corner of the screen on High-DPI displays)

*_CreateWindowFramebuffer()/*_UpdateWindowFramebuffer(): are updated
to use SDL_GetWindowSizeInPixels instead of SDL_GetWindowSize() or
window->w/window->h.

Most of the _CreateWindowFramebuffer backends are untested except
for Windows.

Fixes #7047
This commit is contained in:
Eric Wasylishen 2023-01-11 19:45:01 -07:00 committed by Sam Lantinga
parent 6d11515873
commit 67c91353e0
11 changed files with 57 additions and 35 deletions

View file

@ -90,7 +90,7 @@ static int SW_GetOutputSize(SDL_Renderer *renderer, int *w, int *h)
}
if (renderer->window) {
SDL_GetWindowSize(renderer->window, w, h);
SDL_GetWindowSizeInPixels(renderer->window, w, h);
return 0;
}