MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / UpdateViewportsEndFrame

Method UpdateViewportsEndFrame

extern/imgui/imgui.cpp:13761–13779  ·  view source on GitHub ↗

Update user-facing viewport list (g.Viewports -> g.PlatformIO.Viewports after filtering out some)

Source from the content-addressed store, hash-verified

13759
13760// Update user-facing viewport list (g.Viewports -> g.PlatformIO.Viewports after filtering out some)
13761static void ImGui::UpdateViewportsEndFrame()
13762{
13763 ImGuiContext& g = *GImGui;
13764 g.PlatformIO.Viewports.resize(0);
13765 for (int i = 0; i < g.Viewports.Size; i++)
13766 {
13767 ImGuiViewportP* viewport = g.Viewports[i];
13768 viewport->LastPos = viewport->Pos;
13769 if (viewport->LastFrameActive < g.FrameCount || viewport->Size.x <= 0.0f || viewport->Size.y <= 0.0f)
13770 if (i > 0) // Always include main viewport in the list
13771 continue;
13772 if (viewport->Window && !IsWindowActiveAndVisible(viewport->Window))
13773 continue;
13774 if (i > 0)
13775 IM_ASSERT(viewport->Window != NULL);
13776 g.PlatformIO.Viewports.push_back(viewport);
13777 }
13778 g.Viewports[0]->ClearRequestFlags(); // Clear main viewport flags because UpdatePlatformWindows() won't do it and may not even be called
13779}
13780
13781// FIXME: We should ideally refactor the system to call this every frame (we currently don't)
13782ImGuiViewportP* ImGui::AddUpdateViewport(ImGuiWindow* window, ImGuiID id, const ImVec2& pos, const ImVec2& size, ImGuiViewportFlags flags)

Callers

nothing calls this directly

Calls 4

IsWindowActiveAndVisibleFunction · 0.85
ClearRequestFlagsMethod · 0.80
resizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected