From 2a1bf9316536f63b76b8cf27535d5f796830007f Mon Sep 17 00:00:00 2001 From: def Date: Sun, 9 Jul 2017 09:24:08 +0200 Subject: [PATCH] Try to fix Windows DPI issue --- src/engine/client/backend_sdl.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/engine/client/backend_sdl.cpp b/src/engine/client/backend_sdl.cpp index 5100395d9..3ce08d340 100644 --- a/src/engine/client/backend_sdl.cpp +++ b/src/engine/client/backend_sdl.cpp @@ -4,6 +4,7 @@ // For FlashWindowEx, FLASHWINFO, FLASHW_TRAY #define _WIN32_WINNT 0x0501 #define WINVER 0x0501 + #include #endif #include @@ -622,9 +623,19 @@ int CGraphicsBackend_SDL_OpenGL::Init(const char *pName, int *Screen, int *pWidt } if(Flags&IGraphicsBackend::INITFLAG_HIGHDPI) + { SdlFlags |= SDL_WINDOW_ALLOW_HIGHDPI; +#ifdef CONF_FAMILY_WINDOWS + SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE); +#endif + } else + { SDL_SetHint(SDL_HINT_VIDEO_HIGHDPI_DISABLED, "1"); +#ifdef CONF_FAMILY_WINDOWS + SetProcessDpiAwareness(PROCESS_DPI_UNAWARE); +#endif + } // set gl attributes SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);