mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
ImDrawList: Added Clone() helper function.
This commit is contained in:
@ -338,6 +338,16 @@ void ImDrawList::ClearFreeMemory()
|
||||
_Channels.clear();
|
||||
}
|
||||
|
||||
ImDrawList* ImDrawList::CloneOutput() const
|
||||
{
|
||||
ImDrawList* dst = IM_NEW(ImDrawList(NULL));
|
||||
dst->CmdBuffer = CmdBuffer;
|
||||
dst->IdxBuffer = IdxBuffer;
|
||||
dst->VtxBuffer = VtxBuffer;
|
||||
dst->Flags = Flags;
|
||||
return dst;
|
||||
}
|
||||
|
||||
// Using macros because C++ is a terrible language, we want guaranteed inline, no code in header, and no overhead in Debug builds
|
||||
#define GetCurrentClipRect() (_ClipRectStack.Size ? _ClipRectStack.Data[_ClipRectStack.Size-1] : _Data->ClipRectFullscreen)
|
||||
#define GetCurrentTextureId() (_TextureIdStack.Size ? _TextureIdStack.Data[_TextureIdStack.Size-1] : NULL)
|
||||
|
Reference in New Issue
Block a user