1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-16 00:54:19 +00:00

Merged GetBackgroundDrawList()/GetForegroundDrawList() and GetBackgroundDrawList(ImGuiViewport* viewport)/GetForegroundDrawList(ImGuiViewport* viewport) api entry points.

This commit is contained in:
ocornut 2024-06-28 16:16:51 +02:00
parent 138d9d0c21
commit 3fec562da1
3 changed files with 10 additions and 16 deletions

View file

@ -4519,26 +4519,18 @@ static ImDrawList* GetViewportBgFgDrawList(ImGuiViewportP* viewport, size_t draw
ImDrawList* ImGui::GetBackgroundDrawList(ImGuiViewport* viewport)
{
if (viewport == NULL)
viewport = GImGui->CurrentWindow->Viewport;
return GetViewportBgFgDrawList((ImGuiViewportP*)viewport, 0, "##Background");
}
ImDrawList* ImGui::GetBackgroundDrawList()
{
ImGuiContext& g = *GImGui;
return GetBackgroundDrawList(g.CurrentWindow->Viewport);
}
ImDrawList* ImGui::GetForegroundDrawList(ImGuiViewport* viewport)
{
if (viewport == NULL)
viewport = GImGui->CurrentWindow->Viewport;
return GetViewportBgFgDrawList((ImGuiViewportP*)viewport, 1, "##Foreground");
}
ImDrawList* ImGui::GetForegroundDrawList()
{
ImGuiContext& g = *GImGui;
return GetForegroundDrawList(g.CurrentWindow->Viewport);
}
ImDrawListSharedData* ImGui::GetDrawListSharedData()
{
return &GImGui->DrawListSharedData;