mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-12 22:38:13 +00:00
Added SDL_EVENT_DISPLAY_SCALE_CHANGED
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user