summaryrefslogtreecommitdiff
path: root/inc/opengl
diff options
context:
space:
mode:
authormajortom6 <tombarrett@siu.edu>2017-03-03 15:18:22 -0600
committerTom Barrett <tombarrett@siu.edu>2017-03-07 13:23:42 -0600
commitdfda3f2a5e555d3173359134f4994bcd12d129f8 (patch)
treeadc9d75f1e28332b8c5208fdb3c4685667816dda /inc/opengl
parent3c78d411760beb9332e7282e4ec49a199998c67d (diff)
-removed the Graphics Data class
-replaced with already implemented Rectangle, and put color and side variables in dna (can potentially remove the side variable if it does nothing important)
Diffstat (limited to 'inc/opengl')
-rw-r--r--inc/opengl/graphicsdata.hpp33
-rw-r--r--inc/opengl/spritebatch.hpp10
2 files changed, 5 insertions, 38 deletions
diff --git a/inc/opengl/graphicsdata.hpp b/inc/opengl/graphicsdata.hpp
deleted file mode 100644
index a0398dc..0000000
--- a/inc/opengl/graphicsdata.hpp
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef graphicsdata_h
-#define graphicsdata_h
-
-class GraphicsData
-{
- public:
- GraphicsData(){
- this->x = 0;
- this->y = 0;
- this->r = 0;
- this->g = 0;
- this->b = 0;
- this->sides = 0;
- }
-
- GraphicsData(float x1, float y1, float r1, float g1, float b1, float sides1){
- this->x = x1;
- this->y = y1;
- this->r = r1;
- this->g = g1;
- this->b = b1;
- this->sides = sides1;
- }
-
- float x;
- float y;
- float r;
- float g;
- float b;
- float sides;
-};
-
-#endif
diff --git a/inc/opengl/spritebatch.hpp b/inc/opengl/spritebatch.hpp
index 63e45eb..d1c4d7a 100644
--- a/inc/opengl/spritebatch.hpp
+++ b/inc/opengl/spritebatch.hpp
@@ -5,8 +5,8 @@
#include <vector>
#include <GL/glew.h>
-#include "graphicsdata.hpp"
#include "geoshader.hpp"
+#include "dna.hpp"
class RenderBatch {
public:
@@ -24,7 +24,7 @@ class SpriteBatch
void init();
void begin();
void end();
- void draw(const GraphicsData& gfxData);
+ void draw(Rectangle r, DNA::Visuals v);
void renderBatch();
private:
@@ -34,9 +34,9 @@ class SpriteBatch
GLuint _vbo;
GLuint _vao;
- std::vector<GraphicsData*> _gfxPtr;
- std::vector<GraphicsData> _gfx;
- std::vector<RenderBatch> _renderBatches;
+ std::vector<std::pair<Rectangle,DNA::Visuals>*> _gfxPtr;
+ std::vector<std::pair<Rectangle,DNA::Visuals>> _gfx;
+ std::vector<RenderBatch> _renderBatches;
GeoShader shader;
};