diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 21:22:02 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 21:22:02 +0800 |
| commit | 8b1dafd36151cb319e3ef77f778fcbb2f9348d60 (patch) | |
| tree | e45d6cc1b7f836aae53bbdfc5519a5fc2bd34209 /Minecraft.Client/Windows64 | |
| parent | f90c74d9a3cb5501fe3279bbf9b0186d69f27b7d (diff) | |
feat: add DPI awareness and auto-detect screen resolution
Diffstat (limited to 'Minecraft.Client/Windows64')
| -rw-r--r-- | Minecraft.Client/Windows64/Windows64_Minecraft.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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') |
