1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-01-17 21:09:00 +01:00

turn off High DPI mode by default

add --high-dpi cmd line arg
This commit is contained in:
XProger 2020-04-18 09:20:36 +03:00
parent 8d3620f363
commit 39137fc3c4

View File

@ -971,8 +971,20 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
#endif
// set our process to be DPI aware before creating main window
HMODULE hUser32 = LoadLibrary("User32.dll");
HMODULE hShcore = LoadLibrary("Shcore.dll");
bool high_dpi = false;
for (int i = 0; i < argc; i++) {
if (strcmp(argv[i], "--high-dpi") == 0) {
high_dpi = true;
}
}
HMODULE hUser32 = NULL, hShcore = NULL;
if (high_dpi) {
hUser32 = LoadLibrary("User32.dll");
hShcore = LoadLibrary("Shcore.dll");
}
GetProcAddr(hUser32, _SetProcessDpiAwarenessContext);
GetProcAddr(hShcore, _SetProcessDpiAwareness);
@ -1013,7 +1025,7 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
Core::defLang = checkLanguage();
Game::init(argc > 1 ? argv[1] : NULL);
Game::init((argc > 1 && strstr(argv[1], "--") != argv[1]) ? argv[1] : NULL);
if (Core::isQuit) {
MessageBoxA(hWnd, "Please check the readme file first!", "Game resources not found", MB_ICONHAND);