#include "client/render/gui/FrameMenu.h"
#include "client/render/gui/imgui/imgui.h"

#include "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 !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
