From 8b1dafd36151cb319e3ef77f778fcbb2f9348d60 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 21:22:02 +0800 Subject: feat: add DPI awareness and auto-detect screen resolution --- Minecraft.Client/Windows64/Windows64_Minecraft.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Minecraft.Client/Windows64') diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index cc589771..472d10a6 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -698,6 +698,17 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); + // Declare DPI awareness so GetSystemMetrics returns physical pixels + SetProcessDPIAware(); + g_iScreenWidth = GetSystemMetrics(SM_CXSCREEN); + g_iScreenHeight = GetSystemMetrics(SM_CYSCREEN); + + { + char buf[128]; + sprintf(buf, "Screen resolution: %dx%d\n", g_iScreenWidth, g_iScreenHeight); + OutputDebugStringA(buf); + } + if(lpCmdLine) { if(lpCmdLine[0] == '1') -- cgit v1.2.3