From 07da038b4b8faee91efe10b9c1c0eeaea8e32ed6 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 23 Nov 2025 14:54:15 +0500 Subject: [PATCH] engine: platform: sdl2: move dpi awareness hint set before SDL_Init, as documentation says it needs to be set before video init --- engine/platform/sdl2/sys_sdl2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/platform/sdl2/sys_sdl2.c b/engine/platform/sdl2/sys_sdl2.c index c07be703..d716ce79 100644 --- a/engine/platform/sdl2/sys_sdl2.c +++ b/engine/platform/sdl2/sys_sdl2.c @@ -106,6 +106,10 @@ void SDLash_Init( const char *basedir ) else SDL_LogSetAllPriority( SDL_LOG_PRIORITY_ERROR ); +#if XASH_WIN32 + SDL_SetHint( SDL_HINT_WINDOWS_DPI_AWARENESS, "permonitorv2" ); +#endif // XASH_WIN32 + if( SDL_Init( SDL_INIT_TIMER | SDL_INIT_VIDEO | SDL_INIT_EVENTS ) ) { Sys_Warn( "SDL_Init failed: %s", SDL_GetError() ); @@ -119,10 +123,6 @@ void SDLash_Init( const char *basedir ) #endif // SDL_HINT_MOUSE_TOUCH_EVENTS SDL_SetHint( SDL_HINT_TOUCH_MOUSE_EVENTS, "0" ); -#if XASH_WIN32 - SDL_SetHint( SDL_HINT_WINDOWS_DPI_AWARENESS, "permonitorv2" ); -#endif // XASH_WIN32 - SDL_StopTextInput(); SDLash_InitCursors();