From bfdc713b68dd6f8d61e7b26fc2cff15caf24b44d Mon Sep 17 00:00:00 2001 From: majortom6 Date: Sun, 19 Feb 2017 11:31:57 -0600 Subject: -finished formatting all of the includes, at least for now --- inc/opengl/spritebatch.hpp | 72 +++++++++++++++++----------------------------- 1 file changed, 27 insertions(+), 45 deletions(-) (limited to 'inc/opengl/spritebatch.hpp') diff --git a/inc/opengl/spritebatch.hpp b/inc/opengl/spritebatch.hpp index 3ece593..94ca97c 100644 --- a/inc/opengl/spritebatch.hpp +++ b/inc/opengl/spritebatch.hpp @@ -9,55 +9,37 @@ class RenderBatch { -public: - RenderBatch(GLuint Offset, GLuint NumVertices) : offset(Offset), - numVertices(NumVertices){ - } - GLuint offset; - GLuint numVertices; - //GLuint texture; + public: + RenderBatch(GLuint Offset, GLuint NumVertices) : offset(Offset), + numVertices(NumVertices){} + GLuint offset; + GLuint numVertices; }; - class SpriteBatch { - public: - SpriteBatch(GeoShader theshader); - ~SpriteBatch(); - // Initializes the spritebatch - void init(); - // Begins the spritebatch - void begin(); - // Ends the spritebatch - void end(); - // Adds a glyph to the spritebatch - void draw(const GraphicsData& gfxData); - // Renders the entire SpriteBatch to the screen - void renderBatch(); - - private: - // Creates all the needed RenderBatches - void createRenderBatches(); - // Generates our VAO and VBO - void createVertexArray(); - // Sorts glyphs according to _sortType - //void sortGlyphs(); - // Comparators used by sortGlyphs() - //static bool compareFrontToBack(Glyph* a, Glyph* b); - //static bool compareBackToFront(Glyph* a, Glyph* b); - //static bool compareTexture(Glyph* a, Glyph* b); - - GLuint _vbo; - GLuint _vao; - - //GlyphSortType _sortType; - - std::vector _gfxPtr; ///< This is for sorting - std::vector _gfx; ///< These are the actual glyphs - std::vector _renderBatches; - - GeoShader shader; - + public: + SpriteBatch(GeoShader theshader); + ~SpriteBatch(); + + void init(); + void begin(); + void end(); + void draw(const GraphicsData& gfxData); + void renderBatch(); + + private: + void createRenderBatches(); + void createVertexArray(); + + GLuint _vbo; + GLuint _vao; + + std::vector _gfxPtr; ///< This is for sorting + std::vector _gfx; ///< These are the actual glyphs + std::vector _renderBatches; + + GeoShader shader; }; #endif -- cgit v1.2.3