summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-04-06 16:12:44 +0200
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-04-08 16:29:46 +0200
commit48d8caa6e5e6f2ea12f2eb3c25b21e08a38f66b9 (patch)
tree03d4dcb44ac8fed4872c5dc7705fcc75051d4ab1
parent5aa055cb114ffa1a5cae32f4c929227680b362ba (diff)
downloadmana-48d8caa6e5e6f2ea12f2eb3c25b21e08a38f66b9.tar.gz
mana-48d8caa6e5e6f2ea12f2eb3c25b21e08a38f66b9.tar.bz2
mana-48d8caa6e5e6f2ea12f2eb3c25b21e08a38f66b9.tar.xz
mana-48d8caa6e5e6f2ea12f2eb3c25b21e08a38f66b9.zip
Set Windows-related DPI hints to per-monitor aware v2
Set SDL_HINT_WINDOWS_DPI_AWARENESS to "permonitorv2", which tells Windows the application will handle all scaling. We don't currently adjust the window size when it changes monitors, but mainly use this hint to disable scaling by the system, since that blurs fonts and pixel art. Once we can properly handle fractional scaling (which is common on Windows), we can set SDL_HINT_WINDOWS_DPI_SCALING to "1" instead.
-rw-r--r--src/client.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp
index abd426ce..6fd73d4f 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -240,6 +240,10 @@ Client::Client(const Options &options):
initScreenshotDir();
+#if SDL_VERSION_ATLEAST(2, 24, 0)
+ SDL_SetHint(SDL_HINT_WINDOWS_DPI_AWARENESS, "permonitorv2");
+#endif
+
// Initialize SDL
logger->log("Initializing SDL...");
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0)