aboutsummaryrefslogtreecommitdiffstats
path: root/src/render.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/render.hpp')
-rw-r--r--src/render.hpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/render.hpp b/src/render.hpp
index f3064d1..88668cc 100644
--- a/src/render.hpp
+++ b/src/render.hpp
@@ -36,9 +36,21 @@
#include "shader.hpp"
#include "world.hpp"
+#include "components/Player.hpp"
+#include "events/render.hpp"
#include "events/world.hpp"
-#include "components/Player.hpp"
+#include <map>
+
+struct UIRenderData
+{
+ GLuint tex;
+ GLuint normal;
+ unsigned int vertex;
+
+ UIRenderData(GLuint _tex, GLuint _normal, unsigned int _vertex) :
+ tex(_tex), normal(_normal), vertex(_vertex) {}
+};
class RenderSystem : public entityx::System<RenderSystem>,
public entityx::Receiver<RenderSystem>
@@ -52,8 +64,12 @@ private:
SDL_GLContext context;
Shader worldShader;
+ Shader uiShader;
glm::vec3 camPos;
+ // Map of VBOs and their render data
+ std::map<GLuint, UIRenderData> uiRenders;
+
GLuint worldVBO = 0;
unsigned int worldVertex = 0;
GLuint worldTexture = 0;
@@ -92,8 +108,8 @@ public:
* EVENTS *
************/
void receive(const WorldMeshUpdateEvent &wmu);
+ void receive(const NewRenderEvent &nre);
void receive(const entityx::ComponentAddedEvent<Player> &cae);
-
};
#endif // SYSTEM_RENDER_HPP_