From 10b8dd34caa768e3ff312989192e1ab529934a74 Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 10 Apr 2025 12:00:08 -0500 Subject: [PATCH] fix ImguiEmbed --- ExampleApps.nix | 1 + src/example_apps/ImguiEmbed/ImguiEmbed.cpp | 8 ++++++-- src/example_apps/ImguiEmbed/ImguiEmbed.h | 6 +----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ExampleApps.nix b/ExampleApps.nix index e34b634..d2920f1 100644 --- a/ExampleApps.nix +++ b/ExampleApps.nix @@ -50,6 +50,7 @@ src/example_apps/ImguiEmbed/*.cpp \ modules/examples/GuiModules/TestImgui/src/*.cpp \ modules/WindowModule/src/*.cpp \ + modules/ImguiModule/src/*.cpp \ $imgui/backends/imgui_impl_glfw.cpp \ $imgui/backends/imgui_impl_opengl3.cpp \ $imgui/*.cpp \ diff --git a/src/example_apps/ImguiEmbed/ImguiEmbed.cpp b/src/example_apps/ImguiEmbed/ImguiEmbed.cpp index dcde452..d88acbb 100644 --- a/src/example_apps/ImguiEmbed/ImguiEmbed.cpp +++ b/src/example_apps/ImguiEmbed/ImguiEmbed.cpp @@ -17,8 +17,12 @@ void ImguiEmbed::run() { } toClose.clear(); - for(std::string m : toOpen) { - load(m); + for(auto m : toOpen) { + if(std::holds_alternative(m.second)) { + load(std::get(m.second))->onLoad(); + } else { + load(std::get(m.second))->onLoad(); + } } toOpen.clear(); } diff --git a/src/example_apps/ImguiEmbed/ImguiEmbed.h b/src/example_apps/ImguiEmbed/ImguiEmbed.h index 065ef25..ffa5712 100644 --- a/src/example_apps/ImguiEmbed/ImguiEmbed.h +++ b/src/example_apps/ImguiEmbed/ImguiEmbed.h @@ -11,7 +11,7 @@ class ImguiEmbed : public Archimedes::App { public: ImguiEmbed() { - Archimedes::Module* m = (Archimedes::Module*) new TestImgui(nullptr, Get()); + Archimedes::Module* m = (Archimedes::Module*) new TestImgui(Get(), nullptr); load(m); }; @@ -21,10 +21,6 @@ class ImguiEmbed : public Archimedes::App { void run(); - //void stopModule(std::list::iterator); - - //void startModule(std::string); - }; #define APP_TYPE ImguiEmbed