MCPcopy Create free account
hub / github.com/cinder/Cinder / _ResetForNewFrame

Method _ResetForNewFrame

src/imgui/imgui_draw.cpp:439–463  ·  view source on GitHub ↗

Initialize before use in a new frame. We always have a command ready in the buffer. In the majority of cases, you would want to call PushClipRect() and PushTexture() after this.

Source from the content-addressed store, hash-verified

437// Initialize before use in a new frame. We always have a command ready in the buffer.
438// In the majority of cases, you would want to call PushClipRect() and PushTexture() after this.
439void ImDrawList::_ResetForNewFrame()
440{
441 // Verify that the ImDrawCmd fields we want to memcmp() are contiguous in memory.
442 IM_STATIC_ASSERT(offsetof(ImDrawCmd, ClipRect) == 0);
443 IM_STATIC_ASSERT(offsetof(ImDrawCmd, TexRef) == sizeof(ImVec4));
444 IM_STATIC_ASSERT(offsetof(ImDrawCmd, VtxOffset) == sizeof(ImVec4) + sizeof(ImTextureRef));
445 if (_Splitter._Count > 1)
446 _Splitter.Merge(this);
447
448 CmdBuffer.resize(0);
449 IdxBuffer.resize(0);
450 VtxBuffer.resize(0);
451 Flags = _Data->InitialFlags;
452 memset(&_CmdHeader, 0, sizeof(_CmdHeader));
453 _VtxCurrentIdx = 0;
454 _VtxWritePtr = NULL;
455 _IdxWritePtr = NULL;
456 _ClipRectStack.resize(0);
457 _TextureStack.resize(0);
458 _CallbacksDataBuf.resize(0);
459 _Path.resize(0);
460 _Splitter.Clear();
461 CmdBuffer.push_back(ImDrawCmd());
462 _FringeScale = _Data->InitialFringeScale;
463}
464
465void ImDrawList::_ClearFreeMemory()
466{

Callers 2

GetViewportBgFgDrawListFunction · 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