refactor: changed TowerGui to class
This commit is contained in:
@@ -2,32 +2,58 @@
|
||||
* TowerGUI.h
|
||||
*
|
||||
* Created on: 5 nov. 2020
|
||||
* Author: simon
|
||||
* Author: Persson-dev
|
||||
*/
|
||||
|
||||
#ifndef RENDER_GUI_TOWERGUI_H_
|
||||
#define RENDER_GUI_TOWERGUI_H_
|
||||
#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;
|
||||
|
||||
} // 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;
|
||||
|
||||
bool m_DemoOpened = false;
|
||||
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
|
||||
|
||||
|
||||
namespace TowerGui {
|
||||
|
||||
void init(SDL_Window* window, SDL_GLContext glContext, td::render::Renderer* renderer);
|
||||
void render();
|
||||
void destroy();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* RENDER_GUI_TOWERGUI_H_ */
|
||||
|
||||
Reference in New Issue
Block a user