summaryrefslogtreecommitdiff
path: root/inc/opengl/rectdrawer.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'inc/opengl/rectdrawer.hpp')
-rw-r--r--inc/opengl/rectdrawer.hpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/inc/opengl/rectdrawer.hpp b/inc/opengl/rectdrawer.hpp
new file mode 100644
index 0000000..f2ca1e5
--- /dev/null
+++ b/inc/opengl/rectdrawer.hpp
@@ -0,0 +1,47 @@
+#ifndef rectdrawer_h
+#define rectdrawer_h
+
+
+#include <GL/glew.h>
+#include <vector>
+#include <iostream>
+#include "geoshader.hpp"
+#include "graphicsdata.hpp"
+#include "spritebatch.hpp"
+
+
+//merge this with spritebatch
+class Rectdrawer
+{
+public:
+ Rectdrawer(GeoShader theshader);
+ ~Rectdrawer();
+
+
+ //void init();
+ void begin();
+ void end();
+ void draw(const GraphicsData& gfxData);
+ void renderBatch();
+
+private:
+ // Creates all the needed RenderBatches
+ void createRenderBatches();
+
+
+ GLuint _vbo;
+ GLuint _vao;
+
+
+ std::vector<GraphicsData*> _gfxPtr; ///< This is for sorting
+ std::vector<GraphicsData> _gfx; ///< These are the actual glyphs
+ std::vector<RenderBatch> _renderBatches;
+
+ GeoShader shader;
+
+
+};
+
+
+#endif
+