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

Function RenderViewportsThumbnails

tutorials/common/imgui/imgui.cpp:12906–12925  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12904}
12905
12906static void RenderViewportsThumbnails()
12907{
12908 ImGuiContext& g = *GImGui;
12909 ImGuiWindow* window = g.CurrentWindow;
12910
12911 // We don't display full monitor bounds (we could, but it often looks awkward), instead we display just enough to cover all of our viewports.
12912 float SCALE = 1.0f / 8.0f;
12913 ImRect bb_full(FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX);
12914 for (int n = 0; n < g.Viewports.Size; n++)
12915 bb_full.Add(g.Viewports[n]->GetMainRect());
12916 ImVec2 p = window->DC.CursorPos;
12917 ImVec2 off = p - bb_full.Min * SCALE;
12918 for (int n = 0; n < g.Viewports.Size; n++)
12919 {
12920 ImGuiViewportP* viewport = g.Viewports[n];
12921 ImRect viewport_draw_bb(off + (viewport->Pos) * SCALE, off + (viewport->Pos + viewport->Size) * SCALE);
12922 ImGui::DebugRenderViewportThumbnail(window->DrawList, viewport, viewport_draw_bb);
12923 }
12924 ImGui::Dummy(bb_full.GetSize() * SCALE);
12925}
12926
12927// Helper tool to diagnose between text encoding issues and font loading issues. Pass your UTF-8 string and verify that there are correct.
12928void ImGui::DebugTextEncoding(const char* str)

Callers 1

ShowMetricsWindowMethod · 0.85

Calls 3

AddMethod · 0.80
GetMainRectMethod · 0.80
GetSizeMethod · 0.80

Tested by

no test coverage detected