feat: add DPI awareness and auto-detect screen resolution
This commit is contained in:
1 parent
f90c74d9a3
commit
8b1dafd361
3 files changed
+21
-9
No files matched your search
@@ -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')
|
||||
|
||||
Reference in new issue
Block a user