RtB/src/Gui.hpp

42 lines
1.1 KiB
C++

/* ================================================================
GUI
----------------
Gui.cpp/Gui.hpp provide the class responsible for creating, destroying, and handling GUI elements.
================================================================ */
#ifndef GUI_HPP
#define GUI_HPP
#include "SDL.h"
#include "GuiElement.hpp"
#include "RenderScene.hpp"
#include "RenderCamera.hpp"
#include "AssetManager.hpp"
#include <vector>
class Gui {
friend class Core;
public:
Gui();
~Gui();
int addElement(GuiElement *element);
void updateElements();
int getWidth();
int getHeight();
RenderCamera *getChildCamera();
Program *getProgram();
protected:
int onEvent(SDL_Event event);
int doRender();
int setView(int width, int height);
int w, h;
// Scene/Camera
RenderScene *scene;
RenderCamera *camera;
RenderCamera *child_camera; // weird camera used by children for their rendering
RenderSet *set_basic;
Program *program;
private:
std::vector<GuiElement*> elements;
AssetManager *asset_manager;
Mesh *element_mesh;
};
#endif