/*
 * TowerGUI.h
 *
 *  Created on: 5 nov. 2020
 *      Author: Persson-dev
 */

#pragma once

#include <memory>

struct SDL_Window;
typedef void* SDL_GLContext;

namespace td {

namespace client {

class Client;

} // namespace client

namespace gui {

class MainMenu;
class GameMenu;
class FrameMenu;
class UpdateMenu;

} // namespace gui

namespace render {

class Renderer;

class TowerGui {
private:
    SDL_Window* m_Window;
    SDL_GLContext m_GlContext;
    td::render::Renderer* m_Renderer;
    std::unique_ptr<td::client::Client> m_Client;
    std::unique_ptr<td::gui::MainMenu> m_MainMenu;
    std::unique_ptr<td::gui::GameMenu> m_GameMenu;
    std::unique_ptr<td::gui::FrameMenu> m_FrameMenu;
    std::unique_ptr<td::gui::UpdateMenu> m_UpdateMenu;
public:
    TowerGui(SDL_Window* wndow, SDL_GLContext glContext, td::render::Renderer* renderer);
    ~TowerGui();

    void render();
private:
    void initWidgets();
    void tick();
    void beginFrame();
    void endFrame();
};

} // namespace render
} // namespace td
