add close feature
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ class MainGUI : public Archimedes::Module {
|
||||
void onLoad();
|
||||
|
||||
void run();
|
||||
private:
|
||||
bool open = true;
|
||||
};
|
||||
|
||||
#ifdef MAINGUI_DYNAMIC
|
||||
|
||||
@@ -30,7 +30,7 @@ void TestImgui::run() {
|
||||
if(demo)
|
||||
ImGui::ShowDemoWindow(&this->demo);
|
||||
else
|
||||
app->end();
|
||||
app->stopModule(getName());
|
||||
|
||||
{
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
|
||||
Reference in New Issue
Block a user