Add full high DPI information to SDL_DisplayMode

SDL_DisplayMode now includes the pixel size, the screen size and the relationship between the two. For example, a 4K display at 200% scale could have a pixel size of 3840x2160, a screen size of 1920x1080, and a display scale of 2.0.
This commit is contained in:
Sam Lantinga
2023-01-27 10:46:51 -08:00
parent b23d20cd4d
commit 24fec13ac1
31 changed files with 370 additions and 345 deletions

View File

@@ -108,7 +108,7 @@ draw_modes_menu(SDL_Window *window, SDL_Renderer *renderer, SDL_FRect viewport)
}
(void)SDL_snprintf(text, sizeof text, "%d: %dx%d@%gHz",
i, mode.w, mode.h, mode.refresh_rate);
i, mode.pixel_w, mode.pixel_h, mode.refresh_rate);
/* Update column width */
text_length = (int)SDL_strlen(text);