From 5c1af4eaf8cf4f93680d505e5522f40a6021bcd9 Mon Sep 17 00:00:00 2001 From: GhostlyDark <31742919+GhostlyDark@users.noreply.github.com> Date: Sat, 28 Dec 2024 18:15:21 +0100 Subject: [PATCH] Fix DPI scaling issues on Windows (OpenGL) --- 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 4d907893af..103b7fe8b7 100644 --- a/src/pc/gfx/gfx_sdl2.c +++ b/src/pc/gfx/gfx_sdl2.c @@ -196,6 +196,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);