diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 4edae9ccebc..97d2461e580 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -243,7 +243,7 @@ def configure(env): env.Append(CCFLAGS=['/DGLES2_ENABLED']) env.Append(CCFLAGS=['/DGLEW_ENABLED']) - LIBS=['winmm','opengl32','dsound','kernel32','ole32','oleaut32','user32','gdi32', 'IPHLPAPI','Shcore','Shlwapi', 'wsock32', 'shell32','advapi32','dinput8','dxguid'] + LIBS=['winmm','opengl32','dsound','kernel32','ole32','oleaut32','user32','gdi32', 'IPHLPAPI','Shlwapi', 'wsock32', 'shell32','advapi32','dinput8','dxguid'] env.Append(LINKFLAGS=[p+env["LIBSUFFIX"] for p in LIBS]) env.Append(LIBPATH=[os.getenv("WindowsSdkDir")+"/Lib"]) diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 8bb5de5d5d9..4f2bfd46ae1 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -57,13 +57,6 @@ #include #include -#if (_MSC_VER >= 1700) -#define HIDPI_SUPPORT -#endif - -#ifdef HIDPI_SUPPORT -#include -#endif static const WORD MAX_CONSOLE_LINES = 1500; extern "C" { @@ -781,6 +774,8 @@ LRESULT CALLBACK WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) { } + + void OS_Windows::process_key_events() { for(int i=0;i 0) && (y > 0)) + { + + dpiX = (int)x; + dpiY = (int)y; + } + } + else + { + static int overallX = 0, overallY = 0; + if (overallX <= 0 || overallY <= 0) + { + HDC hdc = GetDC(NULL); + if (hdc) + { + overallX = GetDeviceCaps(hdc, LOGPIXELSX); + overallY = GetDeviceCaps(hdc, LOGPIXELSY); + ReleaseDC(NULL, hdc); + } + } + if (overallX > 0 && overallY > 0) + { + dpiX = overallX; dpiY = overallY; + } + } + + + return (dpiX+dpiY)/2; +} + + BOOL CALLBACK OS_Windows::MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) { OS_Windows *self=(OS_Windows*)OS::get_singleton(); MonitorInfo minfo; @@ -861,13 +925,9 @@ BOOL CALLBACK OS_Windows::MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPR minfo.rect.pos.y=lprcMonitor->top; minfo.rect.size.x=lprcMonitor->right - lprcMonitor->left; minfo.rect.size.y=lprcMonitor->bottom - lprcMonitor->top; -#ifdef HIDPI_SUPPORT - UINT dpix,dpiy; - GetDpiForMonitor(hMonitor,MDT_EFFECTIVE_DPI,&dpix,&dpiy); - minfo.dpi=(dpix + dpiy)/2; -#else - minfo.dpi=72; -#endif + + minfo.dpi = QueryDpiForMonitor(hMonitor); + self->monitor_info.push_back(minfo); return TRUE;