From 52273ab3c1a2690ebea2eb82593d60491b03404a Mon Sep 17 00:00:00 2001 From: assiduous Date: Tue, 24 Mar 2020 17:05:02 -0700 Subject: Updated ImGuiUtils: added ScopedID helper class --- Imgui/interface/ImGuiUtils.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Imgui/interface') diff --git a/Imgui/interface/ImGuiUtils.hpp b/Imgui/interface/ImGuiUtils.hpp index 3c2f68f..8639742 100644 --- a/Imgui/interface/ImGuiUtils.hpp +++ b/Imgui/interface/ImGuiUtils.hpp @@ -126,4 +126,19 @@ bool Combo(const char* label, T* current_item, const std::pair i return value_changed; } +template +class ScopedID +{ +public: + ScopedID(IDType ID) + { + PushID(ID); + } + + ~ScopedID() + { + PopID(); + } +}; + } // namespace ImGui -- cgit v1.2.3