mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-26 02:34:23 +00:00
Internals: Window: Aggregating ImDrawList into the ImGuiWindow structure.
This commit is contained in:
parent
84fe711bdf
commit
bfc0efaae9
2 changed files with 5 additions and 3 deletions
|
|
@ -1918,6 +1918,7 @@ bool ImGuiListClipper::Step()
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
ImGuiWindow::ImGuiWindow(ImGuiContext* context, const char* name)
|
||||
: DrawListInst(&context->DrawListSharedData)
|
||||
{
|
||||
Name = ImStrdup(name);
|
||||
ID = ImHash(name, 0);
|
||||
|
|
@ -1959,7 +1960,7 @@ ImGuiWindow::ImGuiWindow(ImGuiContext* context, const char* name)
|
|||
ItemWidthDefault = 0.0f;
|
||||
FontWindowScale = 1.0f;
|
||||
|
||||
DrawList = IM_NEW(ImDrawList)(&context->DrawListSharedData);
|
||||
DrawList = &DrawListInst;
|
||||
DrawList->_OwnerName = Name;
|
||||
ParentWindow = NULL;
|
||||
RootWindow = NULL;
|
||||
|
|
@ -1978,7 +1979,7 @@ ImGuiWindow::ImGuiWindow(ImGuiContext* context, const char* name)
|
|||
|
||||
ImGuiWindow::~ImGuiWindow()
|
||||
{
|
||||
IM_DELETE(DrawList);
|
||||
IM_ASSERT(DrawList == &DrawListInst);
|
||||
IM_DELETE(Name);
|
||||
for (int i = 0; i != ColumnsStorage.Size; i++)
|
||||
ColumnsStorage[i].~ImGuiColumnsSet();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue