mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-16 09:48:26 +00:00
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:
parent
6d11515873
commit
67c91353e0
11 changed files with 57 additions and 35 deletions
|
@ -39,7 +39,7 @@ int Emscripten_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format
|
|||
SDL_DestroySurface(surface);
|
||||
|
||||
/* Create a new one */
|
||||
SDL_GetWindowSize(window, &w, &h);
|
||||
SDL_GetWindowSizeInPixels(window, &w, &h);
|
||||
|
||||
surface = SDL_CreateSurface(w, h, surface_format);
|
||||
if (surface == NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue