mirror of
https://github.com/ocornut/imgui.git
synced 2026-07-24 09:50:50 +00:00
ImDrawData: fixed late initialized field. (Amend 6f41d13)
Would effectively be initialized on use but best to clear on constructor.
This commit is contained in:
2
imgui.h
2
imgui.h
@@ -3495,7 +3495,7 @@ struct ImDrawList
|
||||
struct ImDrawData
|
||||
{
|
||||
bool Valid; // Only valid after Render() is called and before the next NewFrame() is called.
|
||||
int FrameCount; // Frame counter of the emitter context. For debugging purpose.
|
||||
int FrameCount; // Frame counter of the emitter context. Mostly for debugging purpose.
|
||||
int TotalIdxCount; // For convenience, sum of all ImDrawList's IdxBuffer.Size
|
||||
int TotalVtxCount; // For convenience, sum of all ImDrawList's VtxBuffer.Size
|
||||
ImVector<ImDrawList*> CmdLists; // Array of ImDrawList* to render. The ImDrawLists are owned by ImGuiContext and only pointed to from here.
|
||||
|
||||
@@ -2280,7 +2280,7 @@ void ImDrawListSplitter::SetCurrentChannel(ImDrawList* draw_list, int idx)
|
||||
void ImDrawData::Clear()
|
||||
{
|
||||
Valid = false;
|
||||
TotalIdxCount = TotalVtxCount = 0;
|
||||
FrameCount = TotalIdxCount = TotalVtxCount = 0;
|
||||
CmdLists.resize(0); // The ImDrawList are NOT owned by ImDrawData but e.g. by ImGuiContext, so we don't clear them.
|
||||
DisplayPos = DisplaySize = FramebufferScale = ImVec2(0.0f, 0.0f);
|
||||
OwnerViewport = NULL;
|
||||
|
||||
Reference in New Issue
Block a user