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:
@@ -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[])
|
||||
|
||||
Reference in New Issue
Block a user