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

Method _ResetForNewFrame

KBotExt/imgui/imgui_draw.cpp:386–409  ·  view source on GitHub ↗

Initialize before use in a new frame. We always have a command ready in the buffer.

Source from the content-addressed store, hash-verified

384
385// Initialize before use in a new frame. We always have a command ready in the buffer.
386void ImDrawList::_ResetForNewFrame()
387{
388 // Verify that the ImDrawCmd fields we want to memcmp() are contiguous in memory.
389 IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, ClipRect) == 0);
390 IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, TextureId) == sizeof(ImVec4));
391 IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, VtxOffset) == sizeof(ImVec4) + sizeof(ImTextureID));
392 if (_Splitter._Count > 1)
393 _Splitter.Merge(this);
394
395 CmdBuffer.resize(0);
396 IdxBuffer.resize(0);
397 VtxBuffer.resize(0);
398 Flags = _Data->InitialFlags;
399 memset(&_CmdHeader, 0, sizeof(_CmdHeader));
400 _VtxCurrentIdx = 0;
401 _VtxWritePtr = NULL;
402 _IdxWritePtr = NULL;
403 _ClipRectStack.resize(0);
404 _TextureIdStack.resize(0);
405 _Path.resize(0);
406 _Splitter.Clear();
407 CmdBuffer.push_back(ImDrawCmd());
408 _FringeScale = 1.0f;
409}
410
411void ImDrawList::_ClearFreeMemory()
412{

Callers 2

GetViewportBgFgDrawListFunction · 0.80
BeginMethod · 0.80

Calls 3

ImDrawCmdClass · 0.85
MergeMethod · 0.80
ClearMethod · 0.45

Tested by

no test coverage detected