MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / CompareWithCurrentState

Method CompareWithCurrentState

extern/imgui/imgui.cpp:9616–9636  ·  view source on GitHub ↗

Compare to detect usage errors

Source from the content-addressed store, hash-verified

9614
9615// Compare to detect usage errors
9616void ImGuiStackSizes::CompareWithCurrentState()
9617{
9618 ImGuiContext& g = *GImGui;
9619 ImGuiWindow* window = g.CurrentWindow;
9620 IM_UNUSED(window);
9621
9622 // Window stacks
9623 // NOT checking: DC.ItemWidth, DC.TextWrapPos (per window) to allow user to conveniently push once and not pop (they are cleared on Begin)
9624 IM_ASSERT(SizeOfIDStack == window->IDStack.Size && "PushID/PopID or TreeNode/TreePop Mismatch!");
9625
9626 // Global stacks
9627 // For color, style and font stacks there is an incentive to use Push/Begin/Pop/.../End patterns, so we relax our checks a little to allow them.
9628 IM_ASSERT(SizeOfGroupStack == g.GroupStack.Size && "BeginGroup/EndGroup Mismatch!");
9629 IM_ASSERT(SizeOfBeginPopupStack == g.BeginPopupStack.Size && "BeginPopup/EndPopup or BeginMenu/EndMenu Mismatch!");
9630 IM_ASSERT(SizeOfDisabledStack == g.DisabledStackSize && "BeginDisabled/EndDisabled Mismatch!");
9631 IM_ASSERT(SizeOfItemFlagsStack >= g.ItemFlagsStack.Size && "PushItemFlag/PopItemFlag Mismatch!");
9632 IM_ASSERT(SizeOfColorStack >= g.ColorStack.Size && "PushStyleColor/PopStyleColor Mismatch!");
9633 IM_ASSERT(SizeOfStyleVarStack >= g.StyleVarStack.Size && "PushStyleVar/PopStyleVar Mismatch!");
9634 IM_ASSERT(SizeOfFontStack >= g.FontStack.Size && "PushFont/PopFont Mismatch!");
9635 IM_ASSERT(SizeOfFocusScopeStack == g.FocusScopeStack.Size && "PushFocusScope/PopFocusScope Mismatch!");
9636}
9637
9638
9639//-----------------------------------------------------------------------------

Callers 1

EndMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected