Skip to content

Commit

Permalink
upscale instead of downscaling window on nonstandard DPI configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
asiekierka committed Jan 20, 2024
1 parent 45d0e67 commit b99e3e1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/sdl/frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,16 @@ int main(int argc, char **argv) {
window = renderer->get_window();
sdl_resize_window(0, false, false);

#ifdef _WIN32
{
float dpi = 0.0f;
int display_index = SDL_GetWindowDisplayIndex(window);
if (display_index >= 0 && !SDL_GetDisplayDPI(display_index, &dpi, NULL, NULL)) {
sdl_resize_window((int) ceil(dpi / 96.0f), false, true);
}
}
#endif

SDL_zero(requested_audio_spec);
requested_audio_spec.freq = 48000;
requested_audio_spec.format = AUDIO_S16;
Expand Down

0 comments on commit b99e3e1

Please sign in to comment.