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