diff options
Diffstat (limited to 'dggui/nativewindow_win32.cc')
-rw-r--r-- | dggui/nativewindow_win32.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/dggui/nativewindow_win32.cc b/dggui/nativewindow_win32.cc index db785e9..45cbd30 100644 --- a/dggui/nativewindow_win32.cc +++ b/dggui/nativewindow_win32.cc @@ -489,6 +489,15 @@ std::pair<std::size_t, std::size_t> NativeWindowWin32::getSize() const return std::make_pair(rect.right - rect.left, rect.bottom - rect.top); } +bool NativeWindowWin32::isHiDPI() +{ + HDC hDC = GetDC(m_hwnd); + INT xres = GetDeviceCaps(hDC, LOGPIXELSX); + INT yres = GetDeviceCaps(hDC, LOGPIXELSY); + ReleaseDC(m_hwnd, hDC); + return xres >= 2 * 96 || yres >= 2 * 96; +} + void NativeWindowWin32::move(int x, int y) { SetWindowPos(m_hwnd, always_on_top ? HWND_TOPMOST : nullptr, |