MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / _ResetForNewFrame

Method _ResetForNewFrame

extern/imgui/imgui_draw.cpp:392–415  ·  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

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

Callers 2

GetViewportDrawListFunction · 0.80
BeginMethod · 0.80

Calls 5

ImDrawCmdClass · 0.85
MergeMethod · 0.80
resizeMethod · 0.45
ClearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected