introduce active and passive events

This commit is contained in:
2025-04-23 13:51:09 -05:00
parent a3fb96abb7
commit b4ac013f18
17 changed files with 197 additions and 42 deletions

View File

@@ -10,19 +10,21 @@ TestImgui::TestImgui(Archimedes::App* a, void* h) : Archimedes::Module(a, h) {
}
TestImgui::~TestImgui() {
ImguiModule* im; { im = (ImguiModule*) moduleInstances[ImguiModule()]; }
im->releaseContext(ImGui::GetCurrentContext());
}
void TestImgui::onLoad() {
ImguiModule* im = (ImguiModule*) moduleInstances["ImguiModule"];
ImguiModule* im; { im = (ImguiModule*) moduleInstances[ImguiModule()]; }
if(!im) {
std::cout << "No ImguiModule for TestImgui!\n";
std::abort();
}
ImGui::SetCurrentContext(im->getContext());
ImGui::SetCurrentContext(im->aquireContext());
}
@@ -30,7 +32,7 @@ void TestImgui::run() {
if(demo)
ImGui::ShowDemoWindow(&this->demo);
else
app->stopModule(name);
app->emitEvent(new Archimedes::DoUnloadModuleEvent(name));
{
ImGuiIO& io = ImGui::GetIO();