MCPcopy Create free account
hub / github.com/RenderKit/embree / GetViewportDrawList

Function GetViewportDrawList

tutorials/common/imgui/imgui.cpp:3944–3966  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3942}
3943
3944static ImDrawList* GetViewportDrawList(ImGuiViewportP* viewport, size_t drawlist_no, const char* drawlist_name)
3945{
3946 // Create the draw list on demand, because they are not frequently used for all viewports
3947 ImGuiContext& g = *GImGui;
3948 IM_ASSERT(drawlist_no < IM_ARRAYSIZE(viewport->DrawLists));
3949 ImDrawList* draw_list = viewport->DrawLists[drawlist_no];
3950 if (draw_list == NULL)
3951 {
3952 draw_list = IM_NEW(ImDrawList)(&g.DrawListSharedData);
3953 draw_list->_OwnerName = drawlist_name;
3954 viewport->DrawLists[drawlist_no] = draw_list;
3955 }
3956
3957 // Our ImDrawList system requires that there is always a command
3958 if (viewport->DrawListsLastFrame[drawlist_no] != g.FrameCount)
3959 {
3960 draw_list->_ResetForNewFrame();
3961 draw_list->PushTextureID(g.IO.Fonts->TexID);
3962 draw_list->PushClipRect(viewport->Pos, viewport->Pos + viewport->Size, false);
3963 viewport->DrawListsLastFrame[drawlist_no] = g.FrameCount;
3964 }
3965 return draw_list;
3966}
3967
3968ImDrawList* ImGui::GetBackgroundDrawList(ImGuiViewport* viewport)
3969{

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