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

Method _ResetForNewFrame

tutorials/common/imgui/imgui_draw.cpp:387–408  ·  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

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

Callers 2

GetViewportDrawListFunction · 0.80
BeginMethod · 0.80

Calls 4

ImDrawCmdClass · 0.85
resizeMethod · 0.45
ClearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected