refactor: remove static variables
This commit is contained in:
@@ -6,6 +6,9 @@ namespace td {
|
|||||||
namespace gui {
|
namespace gui {
|
||||||
|
|
||||||
class FrameMenu : public GuiWidget {
|
class FrameMenu : public GuiWidget {
|
||||||
|
private:
|
||||||
|
bool m_VSync;
|
||||||
|
bool m_IsometricView;
|
||||||
public:
|
public:
|
||||||
FrameMenu(client::Client* client);
|
FrameMenu(client::Client* client);
|
||||||
|
|
||||||
|
|||||||
@@ -8,20 +8,18 @@
|
|||||||
namespace td {
|
namespace td {
|
||||||
namespace gui {
|
namespace gui {
|
||||||
|
|
||||||
FrameMenu::FrameMenu(client::Client* client) : GuiWidget(client){
|
FrameMenu::FrameMenu(client::Client* client) : GuiWidget(client), m_VSync(true), m_IsometricView(true){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FrameMenu::render() {
|
void FrameMenu::render() {
|
||||||
ImGui::Begin("FPS Counter");
|
ImGui::Begin("FPS Counter");
|
||||||
ImGui::Text("FPS : %i", (int)ImGui::GetIO().Framerate);
|
ImGui::Text("FPS : %i", (int)ImGui::GetIO().Framerate);
|
||||||
static bool vsync = true;
|
if (ImGui::Checkbox("V-Sync", &m_VSync)) {
|
||||||
if (ImGui::Checkbox("V-Sync", &vsync)) {
|
SDL_GL_SetSwapInterval(m_VSync);
|
||||||
SDL_GL_SetSwapInterval(vsync);
|
|
||||||
}
|
}
|
||||||
static bool isometric = true;
|
if (ImGui::Checkbox("Vue Isometrique ?", &m_IsometricView)) {
|
||||||
if (ImGui::Checkbox("Vue Isometrique ?", &isometric)) {
|
getClient()->getRenderer()->setIsometricView(m_IsometricView);
|
||||||
getClient()->getRenderer()->setIsometricView(isometric);
|
|
||||||
}
|
}
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user