Called once a frame. Followed by SetCurrentFont() which sets up the remaining data. FIXME-VIEWPORT: the concept of a single ClipRectFullscreen is not ideal!
| 5475 | // Called once a frame. Followed by SetCurrentFont() which sets up the remaining data. |
| 5476 | // FIXME-VIEWPORT: the concept of a single ClipRectFullscreen is not ideal! |
| 5477 | static void SetupDrawListSharedData() |
| 5478 | { |
| 5479 | ImGuiContext& g = *GImGui; |
| 5480 | ImRect virtual_space(FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX); |
| 5481 | for (ImGuiViewportP* viewport : g.Viewports) |
| 5482 | virtual_space.Add(viewport->GetMainRect()); |
| 5483 | g.DrawListSharedData.ClipRectFullscreen = virtual_space.ToVec4(); |
| 5484 | g.DrawListSharedData.CurveTessellationTol = g.Style.CurveTessellationTol; |
| 5485 | g.DrawListSharedData.SetCircleTessellationMaxError(g.Style.CircleTessellationMaxError); |
| 5486 | g.DrawListSharedData.InitialFlags = ImDrawListFlags_None; |
| 5487 | if (g.Style.AntiAliasedLines) |
| 5488 | g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedLines; |
| 5489 | if (g.Style.AntiAliasedLinesUseTex && !(g.IO.Fonts->Flags & ImFontAtlasFlags_NoBakedLines)) |
| 5490 | g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedLinesUseTex; |
| 5491 | if (g.Style.AntiAliasedFill) |
| 5492 | g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedFill; |
| 5493 | if (g.IO.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset) |
| 5494 | g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AllowVtxOffset; |
| 5495 | g.DrawListSharedData.InitialFringeScale = 1.0f; // FIXME-DPI: Change this for some DPI scaling experiments. |
| 5496 | } |
| 5497 | |
| 5498 | void ImGui::NewFrame() |
| 5499 | { |
no test coverage detected