Updated SDL high DPI support

We have gotten feedback that abstracting the coordinate system based on the display scale is unexpected and it is difficult to adapt existing applications to the proposed API.

The new approach is to provide the coordinate systems that people expect, but provide additional information that will help applications properly handle high DPI situations.

The concepts needed for high DPI support are documented in README-highdpi.md. An example of automatically adapting the content to display scale changes can be found in SDL_test_common.c, where auto_scale_content is checked.

Also, the SDL_WINDOW_ALLOW_HIGHDPI window flag has been replaced by the SDL_HINT_VIDEO_ENABLE_HIGH_PIXEL_DENSITY hint.

Fixes https://github.com/libsdl-org/SDL/issues/7709
This commit is contained in:
Sam Lantinga 2023-05-16 16:29:52 -07:00
parent 0fbb9c779c
commit c699f3d1d8
51 changed files with 506 additions and 882 deletions

View file

@ -863,7 +863,6 @@
#define SDL_ConvertEventToRenderCoordinates SDL_ConvertEventToRenderCoordinates_REAL
#define SDL_SetRenderScale SDL_SetRenderScale_REAL
#define SDL_GetRenderScale SDL_GetRenderScale_REAL
#define SDL_GetRenderWindowSize SDL_GetRenderWindowSize_REAL
#define SDL_GetSystemTheme SDL_GetSystemTheme_REAL
#define SDL_CreatePopupWindow SDL_CreatePopupWindow_REAL
#define SDL_GetWindowParent SDL_GetWindowParent_REAL
@ -882,3 +881,5 @@
#define SDL_UnlockRWLock SDL_UnlockRWLock_REAL
#define SDL_DestroyRWLock SDL_DestroyRWLock_REAL
#define SDL_GetPath SDL_GetPath_REAL
#define SDL_GetDisplayContentScale SDL_GetDisplayContentScale_REAL
#define SDL_GetWindowDisplayScale SDL_GetWindowDisplayScale_REAL