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

@@ -24,9 +24,9 @@ print_mode(const char *prefix, const SDL_DisplayMode *mode)
return;
}
SDL_Log("%s: fmt=%s w=%d h=%d refresh=%gHz\n",
SDL_Log("%s: fmt=%s w=%d h=%d scale=%d%% refresh=%gHz\n",
prefix, SDL_GetPixelFormatName(mode->format),
mode->w, mode->h, mode->refresh_rate);
mode->pixel_w, mode->pixel_h, (int)(mode->display_scale * 100.0f), mode->refresh_rate);
}
int main(int argc, char *argv[])