add close feature

This commit is contained in:
2025-04-12 20:26:12 -05:00
parent dea35c2a5e
commit 372e46168f
3 changed files with 24 additions and 17 deletions

View File

@@ -29,10 +29,11 @@ void MainGUI::onLoad() {
void MainGUI::run() {
if(open) {
ImGuiIO& io = ImGui::GetIO();
static std::string s;
ImGui::Begin("MainGUI Module");
ImGui::Begin("MainGUI Module", &open);
ImGui::Text("Active Modules:");
for(auto m : app->getModuleNames())
@@ -51,4 +52,8 @@ void MainGUI::run() {
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate);
ImGui::End();
} else {
app->end();
}
}

View File

@@ -10,6 +10,8 @@ class MainGUI : public Archimedes::Module {
void onLoad();
void run();
private:
bool open = true;
};
#ifdef MAINGUI_DYNAMIC

View File

@@ -30,7 +30,7 @@ void TestImgui::run() {
if(demo)
ImGui::ShowDemoWindow(&this->demo);
else
app->end();
app->stopModule(getName());
{
ImGuiIO& io = ImGui::GetIO();