ImDrawData: added AddDrawList() helper function. (#6406, #4879, #1878)

This commit is contained in:
ocornut
2023-07-12 16:57:38 +02:00
parent c649aca20a
commit 1a9ddd2396
4 changed files with 14 additions and 2 deletions

View File

@ -1817,6 +1817,17 @@ void ImDrawData::Clear()
OwnerViewport = NULL;
}
void ImDrawData::AddDrawList(ImDrawList* draw_list)
{
IM_ASSERT(Valid);
IM_ASSERT(CmdLists.Size == CmdListsCount);
draw_list->_PopUnusedDrawCmd();
CmdLists.push_back(draw_list);
CmdListsCount++;
TotalVtxCount += draw_list->VtxBuffer.Size;
TotalIdxCount += draw_list->IdxBuffer.Size;
}
// For backward compatibility: convert all buffers from indexed to de-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering!
void ImDrawData::DeIndexAllBuffers()
{