From: bones_was_here Date: Mon, 6 Nov 2023 17:52:15 +0000 (+1000) Subject: Windows: opt out of DPI scaling X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d33a1d0ffb434270de498c386271e484f90e6716;p=xonotic%2Fdarkplaces.git 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 --- 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");