MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / SetupDrawListSharedData

Function SetupDrawListSharedData

imgui_tiny_app/imgui/imgui.cpp:5662–5681  ·  view source on GitHub ↗

Called once a frame. Followed by SetCurrentFont() which sets up the remaining data. FIXME-VIEWPORT: the concept of a single ClipRectFullscreen is not ideal!

Source from the content-addressed store, hash-verified

5660// Called once a frame. Followed by SetCurrentFont() which sets up the remaining data.
5661// FIXME-VIEWPORT: the concept of a single ClipRectFullscreen is not ideal!
5662static void SetupDrawListSharedData()
5663{
5664 ImGuiContext& g = *GImGui;
5665 ImRect virtual_space(FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX);
5666 for (ImGuiViewportP* viewport : g.Viewports)
5667 virtual_space.Add(viewport->GetMainRect());
5668 g.DrawListSharedData.ClipRectFullscreen = virtual_space.ToVec4();
5669 g.DrawListSharedData.CurveTessellationTol = g.Style.CurveTessellationTol;
5670 g.DrawListSharedData.SetCircleTessellationMaxError(g.Style.CircleTessellationMaxError);
5671 g.DrawListSharedData.InitialFlags = ImDrawListFlags_None;
5672 if (g.Style.AntiAliasedLines)
5673 g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedLines;
5674 if (g.Style.AntiAliasedLinesUseTex && !(g.IO.Fonts->Flags & ImFontAtlasFlags_NoBakedLines))
5675 g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedLinesUseTex;
5676 if (g.Style.AntiAliasedFill)
5677 g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedFill;
5678 if (g.IO.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset)
5679 g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AllowVtxOffset;
5680 g.DrawListSharedData.InitialFringeScale = 1.0f; // FIXME-DPI: Change this for some DPI scaling experiments.
5681}
5682
5683void ImGui::NewFrame()
5684{

Callers 1

NewFrameMethod · 0.85

Calls 3

GetMainRectMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected