refactor: change demo window declaration
This commit is contained in:
@@ -9,6 +9,7 @@ class FrameMenu : public GuiWidget {
|
||||
private:
|
||||
bool m_VSync;
|
||||
bool m_IsometricView;
|
||||
bool m_ShowDemoWindow;
|
||||
public:
|
||||
FrameMenu(client::Client* client);
|
||||
|
||||
|
||||
@@ -43,8 +43,6 @@ private:
|
||||
std::unique_ptr<td::gui::GameMenu> m_GameMenu;
|
||||
std::unique_ptr<td::gui::FrameMenu> m_FrameMenu;
|
||||
std::unique_ptr<td::gui::UpdateMenu> m_UpdateMenu;
|
||||
|
||||
bool m_DemoOpened = true;
|
||||
public:
|
||||
TowerGui(SDL_Window* wndow, SDL_GLContext glContext, td::render::Renderer* renderer);
|
||||
~TowerGui();
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
namespace td {
|
||||
namespace gui {
|
||||
|
||||
FrameMenu::FrameMenu(client::Client* client) : GuiWidget(client), m_VSync(true), m_IsometricView(true){
|
||||
FrameMenu::FrameMenu(client::Client* client) : GuiWidget(client), m_VSync(true), m_IsometricView(true), m_ShowDemoWindow(false){
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,11 @@ void FrameMenu::render() {
|
||||
if (ImGui::Checkbox("Vue Isometrique ?", &m_IsometricView)) {
|
||||
getClient()->getRenderer()->setIsometricView(m_IsometricView);
|
||||
}
|
||||
ImGui::Checkbox("Demo Window", &m_ShowDemoWindow);
|
||||
ImGui::End();
|
||||
|
||||
if(m_ShowDemoWindow)
|
||||
ImGui::ShowDemoWindow(&m_ShowDemoWindow);
|
||||
}
|
||||
|
||||
} // namespace gui
|
||||
|
||||
@@ -74,9 +74,6 @@ void TowerGui::render() {
|
||||
else
|
||||
m_MainMenu->render();
|
||||
|
||||
if (m_DemoOpened)
|
||||
ImGui::ShowDemoWindow(&m_DemoOpened);
|
||||
|
||||
m_FrameMenu->render();
|
||||
m_UpdateMenu->render();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user