add close feature
This commit is contained in:
@@ -29,10 +29,11 @@ void MainGUI::onLoad() {
|
|||||||
|
|
||||||
void MainGUI::run() {
|
void MainGUI::run() {
|
||||||
|
|
||||||
|
if(open) {
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
static std::string s;
|
static std::string s;
|
||||||
|
|
||||||
ImGui::Begin("MainGUI Module");
|
ImGui::Begin("MainGUI Module", &open);
|
||||||
|
|
||||||
ImGui::Text("Active Modules:");
|
ImGui::Text("Active Modules:");
|
||||||
for(auto m : app->getModuleNames())
|
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::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate);
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
} else {
|
||||||
|
app->end();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ class MainGUI : public Archimedes::Module {
|
|||||||
void onLoad();
|
void onLoad();
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
|
private:
|
||||||
|
bool open = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef MAINGUI_DYNAMIC
|
#ifdef MAINGUI_DYNAMIC
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ void TestImgui::run() {
|
|||||||
if(demo)
|
if(demo)
|
||||||
ImGui::ShowDemoWindow(&this->demo);
|
ImGui::ShowDemoWindow(&this->demo);
|
||||||
else
|
else
|
||||||
app->end();
|
app->stopModule(getName());
|
||||||
|
|
||||||
{
|
{
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
|||||||
Reference in New Issue
Block a user