MCPcopy Create free account
hub / github.com/RenderKit/embree / UpdateViewportsNewFrame

Method UpdateViewportsNewFrame

tutorials/common/imgui/imgui.cpp:12648–12670  ·  view source on GitHub ↗

Update viewports and monitor infos

Source from the content-addressed store, hash-verified

12646
12647// Update viewports and monitor infos
12648static void ImGui::UpdateViewportsNewFrame()
12649{
12650 ImGuiContext& g = *GImGui;
12651 IM_ASSERT(g.Viewports.Size == 1);
12652
12653 // Update main viewport with current platform position.
12654 // FIXME-VIEWPORT: Size is driven by backend/user code for backward-compatibility but we should aim to make this more consistent.
12655 ImGuiViewportP* main_viewport = g.Viewports[0];
12656 main_viewport->Flags = ImGuiViewportFlags_IsPlatformWindow | ImGuiViewportFlags_OwnedByApp;
12657 main_viewport->Pos = ImVec2(0.0f, 0.0f);
12658 main_viewport->Size = g.IO.DisplaySize;
12659
12660 for (int n = 0; n < g.Viewports.Size; n++)
12661 {
12662 ImGuiViewportP* viewport = g.Viewports[n];
12663
12664 // Lock down space taken by menu bars and status bars, reset the offset for fucntions like BeginMainMenuBar() to alter them again.
12665 viewport->WorkOffsetMin = viewport->BuildWorkOffsetMin;
12666 viewport->WorkOffsetMax = viewport->BuildWorkOffsetMax;
12667 viewport->BuildWorkOffsetMin = viewport->BuildWorkOffsetMax = ImVec2(0.0f, 0.0f);
12668 viewport->UpdateWorkRect();
12669 }
12670}
12671
12672//-----------------------------------------------------------------------------
12673// [SECTION] DOCKING

Callers

nothing calls this directly

Calls 2

ImVec2Function · 0.85
UpdateWorkRectMethod · 0.80

Tested by

no test coverage detected