|
@@ -318,8 +318,19 @@ void _glfwGetMonitorContentScaleWin32(HMONITOR handle, float* xscale, float* ysc
|
|
|
{
|
|
|
UINT xdpi, ydpi;
|
|
|
|
|
|
+ if (xscale)
|
|
|
+ *xscale = 0.f;
|
|
|
+ if (yscale)
|
|
|
+ *yscale = 0.f;
|
|
|
+
|
|
|
if (IsWindows8Point1OrGreater())
|
|
|
- GetDpiForMonitor(handle, MDT_EFFECTIVE_DPI, &xdpi, &ydpi);
|
|
|
+ {
|
|
|
+ if (GetDpiForMonitor(handle, MDT_EFFECTIVE_DPI, &xdpi, &ydpi) != S_OK)
|
|
|
+ {
|
|
|
+ _glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to query monitor DPI");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
const HDC dc = GetDC(NULL);
|