Viewport, Platform, DPI: Back-end store per-monitor DPI information in ImGuiPlatformMonitor. (#1542, #1676)

This commit is contained in:
omar
2018-04-13 18:07:23 +02:00
parent f270d6c52c
commit 950539b768
5 changed files with 29 additions and 17 deletions

View File

@ -550,11 +550,12 @@ static LRESULT CALLBACK ImGui_ImplWin32_WndProcHandler_PlatformWindow(HWND hWnd,
return DefWindowProc(hWnd, msg, wParam, lParam);
}
static BOOL CALLBACK ImGui_ImplWin32_UpdateMonitors_EnumFunc(HMONITOR, HDC, LPRECT rect, LPARAM)
static BOOL CALLBACK ImGui_ImplWin32_UpdateMonitors_EnumFunc(HMONITOR monitor, HDC, LPRECT rect, LPARAM)
{
ImGuiPlatformMonitor imgui_monitor;
imgui_monitor.Pos = ImVec2((float)rect->left, (float)rect->top);
imgui_monitor.Size = ImVec2((float)(rect->right - rect->left), (float)(rect->bottom - rect->top));
imgui_monitor.DpiScale = ImGui_ImplWin32_GetDpiScaleForMonitor(monitor);
ImGui::GetPlatformIO().Monitors.push_back(imgui_monitor);
return TRUE;
}