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

@@ -14,8 +14,25 @@ ChatClient::ChatClient(Archimedes::App* a, void* h) : Module(a, h) {
deps[*im] = im;
}
ChatClient::~ChatClient() {
if(app) {
ImguiModule* im; { im = (ImguiModule*) moduleInstances[ImguiModule()]; }
im->releaseContext(ImGui::GetCurrentContext());
}
}
void ChatClient::onLoad() {
ImguiModule* im; { im = (ImguiModule*) moduleInstances[ImguiModule()]; }
if(!im) {
std::cout << "No ImguiModule for TestImgui!\n";
std::abort();
}
ImGui::SetCurrentContext(im->aquireContext());
}
@@ -58,7 +75,7 @@ void ChatClient::run() {
ImGui::End();
} else {
app->stopModule(name);
app->emitEvent(new Archimedes::DoUnloadModuleEvent(name));
}
}

View File

@@ -12,9 +12,7 @@ class ChatClient : public Archimedes::Module {
ChatClient() { name = "ChatClient"; }
~ChatClient() {
if(app) {}
}
~ChatClient();
void onLoad();