MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / GetViewportBgFgDrawList

Function GetViewportBgFgDrawList

KBotExt/imgui/imgui.cpp:4254–4276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4252}
4253
4254static ImDrawList* GetViewportBgFgDrawList(ImGuiViewportP* viewport, size_t drawlist_no, const char* drawlist_name)
4255{
4256 // Create the draw list on demand, because they are not frequently used for all viewports
4257 ImGuiContext& g = *GImGui;
4258 IM_ASSERT(drawlist_no < IM_ARRAYSIZE(viewport->BgFgDrawLists));
4259 ImDrawList* draw_list = viewport->BgFgDrawLists[drawlist_no];
4260 if (draw_list == NULL)
4261 {
4262 draw_list = IM_NEW(ImDrawList)(&g.DrawListSharedData);
4263 draw_list->_OwnerName = drawlist_name;
4264 viewport->BgFgDrawLists[drawlist_no] = draw_list;
4265 }
4266
4267 // Our ImDrawList system requires that there is always a command
4268 if (viewport->BgFgDrawListsLastFrame[drawlist_no] != g.FrameCount)
4269 {
4270 draw_list->_ResetForNewFrame();
4271 draw_list->PushTextureID(g.IO.Fonts->TexID);
4272 draw_list->PushClipRect(viewport->Pos, viewport->Pos + viewport->Size, false);
4273 viewport->BgFgDrawListsLastFrame[drawlist_no] = g.FrameCount;
4274 }
4275 return draw_list;
4276}
4277
4278ImDrawList* ImGui::GetBackgroundDrawList(ImGuiViewport* viewport)
4279{

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