From d86e2cc4338a681c570f2600063f65fdd20e09c9 Mon Sep 17 00:00:00 2001 From: GhostlyDark <31742919+GhostlyDark@users.noreply.github.com> Date: Sun, 1 Sep 2024 14:44:17 +0200 Subject: [PATCH] Fix DPI scaling issues on Windows --- src/pc/gfx/gfx_sdl2.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pc/gfx/gfx_sdl2.c b/src/pc/gfx/gfx_sdl2.c index 243a7043..4037b695 100644 --- a/src/pc/gfx/gfx_sdl2.c +++ b/src/pc/gfx/gfx_sdl2.c @@ -151,6 +151,11 @@ static void gfx_sdl_reset_dimension_and_pos(void) { } static void gfx_sdl_init(const char *window_title) { + #if SDL_VERSION_ATLEAST(2,24,0) + /* fix DPI scaling issues on Windows */ + SDL_SetHint(SDL_HINT_WINDOWS_DPI_AWARENESS, "permonitorv2"); + #endif + SDL_Init(SDL_INIT_VIDEO); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);