MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / GetViewportDrawList

Function GetViewportDrawList

plugins/Cardinal/src/DearImGui/imgui.cpp:3568–3590  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3566}
3567
3568static ImDrawList* GetViewportDrawList(ImGuiViewportP* viewport, size_t drawlist_no, const char* drawlist_name)
3569{
3570 // Create the draw list on demand, because they are not frequently used for all viewports
3571 ImGuiContext& g = *GImGui;
3572 IM_ASSERT(drawlist_no < IM_ARRAYSIZE(viewport->DrawLists));
3573 ImDrawList* draw_list = viewport->DrawLists[drawlist_no];
3574 if (draw_list == NULL)
3575 {
3576 draw_list = IM_NEW(ImDrawList)(&g.DrawListSharedData);
3577 draw_list->_OwnerName = drawlist_name;
3578 viewport->DrawLists[drawlist_no] = draw_list;
3579 }
3580
3581 // Our ImDrawList system requires that there is always a command
3582 if (viewport->DrawListsLastFrame[drawlist_no] != g.FrameCount)
3583 {
3584 draw_list->_ResetForNewFrame();
3585 draw_list->PushTextureID(g.IO.Fonts->TexID);
3586 draw_list->PushClipRect(viewport->Pos, viewport->Pos + viewport->Size, false);
3587 viewport->DrawListsLastFrame[drawlist_no] = g.FrameCount;
3588 }
3589 return draw_list;
3590}
3591
3592ImDrawList* ImGui::GetBackgroundDrawList(ImGuiViewport* viewport)
3593{

Callers 2

GetBackgroundDrawListMethod · 0.85
GetForegroundDrawListMethod · 0.85

Calls 3

_ResetForNewFrameMethod · 0.80
PushTextureIDMethod · 0.80
PushClipRectMethod · 0.45

Tested by

no test coverage detected