mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-16 17:58:27 +00:00
Added SDL_EVENT_DISPLAY_SCALE_CHANGED
This commit is contained in:
parent
16f4e37bb5
commit
6b87d1938f
6 changed files with 30 additions and 6 deletions
|
@ -1511,6 +1511,17 @@ static void SDLTest_PrintEvent(SDL_Event *event)
|
|||
SDL_Log("SDL EVENT: Display %" SDL_PRIu32 " connected",
|
||||
event->display.displayID);
|
||||
break;
|
||||
case SDL_EVENT_DISPLAY_SCALE_CHANGED:
|
||||
{
|
||||
float display_scale = 1.0f;
|
||||
const SDL_DisplayMode *mode = SDL_GetDesktopDisplayMode(event->display.displayID);
|
||||
if (mode) {
|
||||
display_scale = mode->display_scale;
|
||||
}
|
||||
SDL_Log("SDL EVENT: Display %" SDL_PRIu32 " changed scale to %d%%",
|
||||
event->display.displayID, (int)(display_scale * 100.0f));
|
||||
}
|
||||
break;
|
||||
case SDL_EVENT_DISPLAY_MOVED:
|
||||
SDL_Log("SDL EVENT: Display %" SDL_PRIu32 " changed position",
|
||||
event->display.displayID);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue