From 1efe681967cc764db3185134e0750349061a6e41 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 20 Mar 2025 23:22:51 +0000 Subject: Support capturing and reacting to ImGui window closure --- ui/gameMainSelector.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ui/gameMainSelector.cpp') diff --git a/ui/gameMainSelector.cpp b/ui/gameMainSelector.cpp index 55d0ae0..0c40abc 100644 --- a/ui/gameMainSelector.cpp +++ b/ui/gameMainSelector.cpp @@ -13,10 +13,14 @@ GameMainSelector::GameMainSelector(const Camera * c) : camera {c} { } constexpr ScreenAbsCoord TargetPos {5, 45}; void -GameMainSelector::render() const +GameMainSelector::render() { if (target) { - target->render(); + bool open = true; + target->render(open); + if (!open) { + target.reset(); + } } } @@ -86,7 +90,7 @@ GameMainSelector::Component::handleInput(const SDL_Event &) } void -GameMainSelector::Component::render() +GameMainSelector::Component::render(bool &) { } -- cgit v1.2.3