Files
Tower-Defense/src/render/gui/FrameMenu.cpp
2023-01-02 13:05:43 +01:00

41 lines
855 B
C++

#include "render/gui/FrameMenu.h"
#include "render/gui/imgui/imgui.h"
#include "game/client/Client.h"
#include <SDL2/SDL.h>
namespace td {
namespace gui {
FrameMenu::FrameMenu(client::Client* client) : GuiWidget(client), m_VSync(true), m_IsometricView(true), m_ShowDemoWindow(false) {
}
void FrameMenu::Render() {
ImGui::Begin("FPS Counter");
ImGui::Text("FPS : %i", (int)ImGui::GetIO().Framerate);
if (ImGui::Checkbox("V-Sync", &m_VSync)) {
SDL_GL_SetSwapInterval(m_VSync);
}
if (ImGui::Checkbox("Vue Isometrique ?", &m_IsometricView)) {
GetClient()->GetRenderer()->SetIsometricView(m_IsometricView);
}
#if !defined(NDEBUG)
ImGui::Checkbox("Demo Window", &m_ShowDemoWindow);
#endif
ImGui::End();
#if !defined(NDEBUG)
if (m_ShowDemoWindow)
ImGui::ShowDemoWindow(&m_ShowDemoWindow);
#endif
}
} // namespace gui
} // namespace td