From d33a1d0ffb434270de498c386271e484f90e6716 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Tue, 7 Nov 2023 03:52:15 +1000 Subject: [PATCH] Windows: opt out of DPI scaling SDL >= 2.24.0 is required. Fixes https://gitlab.com/xonotic/darkplaces/-/issues/32 Fixes https://github.com/DarkPlacesEngine/darkplaces/issues/74 Signed-off-by: bones_was_here --- vid_sdl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vid_sdl.c b/vid_sdl.c index 5c7721a9..6f39dd5f 100644 --- a/vid_sdl.c +++ b/vid_sdl.c @@ -1714,6 +1714,11 @@ static qbool VID_InitModeGL(viddef_mode_t *mode) #endif } + // DPI scaling prevents use of the native resolution, causing blurry rendering + // and/or mouse cursor problems, so we need to opt-out. +#ifdef WIN32 + SDL_SetHint(SDL_HINT_WINDOWS_DPI_AWARENESS, "1"); +#endif if (vid_mouse_clickthrough.integer) SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1"); -- 2.39.2