]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Windows: opt out of DPI scaling
authorbones_was_here <bones_was_here@xonotic.au>
Mon, 6 Nov 2023 17:52:15 +0000 (03:52 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Wed, 8 Nov 2023 17:26:49 +0000 (03:26 +1000)
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 <bones_was_here@xonotic.au>
vid_sdl.c

index 5c7721a9687d17218ada1be6ae443cfeb70d2955..6f39dd5f72791d069c9d311bfb95e83eb618c30c 100644 (file)
--- 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");