Viewport: Merged ImGuiPlatformData into ImGuiPlatformIO. Comments. (#1542)

This commit is contained in:
omar
2018-04-10 22:58:39 +02:00
parent 32ee0a3947
commit 83bd3595a4
6 changed files with 64 additions and 69 deletions

View File

@ -408,7 +408,7 @@ static void ImGui_ImplWin32_DestroyWindow(ImGuiViewport* viewport)
{
if (::GetCapture() == data->Hwnd)
{
// Transfer capture so if we started dragging from a window that later disappears, we'll still release the MOUSEUP event.
// Transfer capture so if we started dragging from a window that later disappears, we'll still receive the MOUSEUP event.
::ReleaseCapture();
::SetCapture(g_hWnd);
}
@ -540,14 +540,14 @@ static BOOL CALLBACK ImGui_ImplWin32_UpdateMonitors_EnumFunc(HMONITOR, HDC, LPRE
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::GetPlatformData()->Monitors.push_back(imgui_monitor);
ImGui::GetPlatformIO().Monitors.push_back(imgui_monitor);
return TRUE;
}
// FIXME-PLATFORM: Update list when changed (WM_DISPLAYCHANGE?)
static void ImGui_ImplWin32_UpdateMonitors()
{
ImGui::GetPlatformData()->Monitors.resize(0);
ImGui::GetPlatformIO().Monitors.resize(0);
::EnumDisplayMonitors(NULL, NULL, ImGui_ImplWin32_UpdateMonitors_EnumFunc, NULL);
}