MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / DestroyViewport

Method DestroyViewport

extern/imgui/imgui.cpp:13845–13867  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13843}
13844
13845static void ImGui::DestroyViewport(ImGuiViewportP* viewport)
13846{
13847 // Clear references to this viewport in windows (window->ViewportId becomes the master data)
13848 ImGuiContext& g = *GImGui;
13849 for (int window_n = 0; window_n < g.Windows.Size; window_n++)
13850 {
13851 ImGuiWindow* window = g.Windows[window_n];
13852 if (window->Viewport != viewport)
13853 continue;
13854 window->Viewport = NULL;
13855 window->ViewportOwned = false;
13856 }
13857 if (viewport == g.MouseLastHoveredViewport)
13858 g.MouseLastHoveredViewport = NULL;
13859
13860 // Destroy
13861 IMGUI_DEBUG_LOG_VIEWPORT("[viewport] Delete Viewport %08X '%s'\n", viewport->ID, viewport->Window ? viewport->Window->Name : "n/a");
13862 DestroyPlatformWindow(viewport); // In most circumstances the platform window will already be destroyed here.
13863 IM_ASSERT(g.PlatformIO.Viewports.contains(viewport) == false);
13864 IM_ASSERT(g.Viewports[viewport->Idx] == viewport);
13865 g.Viewports.erase(g.Viewports.Data + viewport->Idx);
13866 IM_DELETE(viewport);
13867}
13868
13869// FIXME-VIEWPORT: This is all super messy and ought to be clarified or rewritten.
13870static void ImGui::WindowSelectViewport(ImGuiWindow* window)

Callers

nothing calls this directly

Calls 3

IM_DELETEFunction · 0.85
eraseMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected