Called once a frame. Followed by SetCurrentFont() which sets up the remaining data. FIXME-VIEWPORT: the concept of a single ClipRectFullscreen is not ideal!
| 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! |
| 5662 | static 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 | |
| 5683 | void ImGui::NewFrame() |
| 5684 | { |
no test coverage detected