diff options
Diffstat (limited to 'src/batch.hpp')
| -rw-r--r-- | src/batch.hpp | 72 |
1 files changed, 38 insertions, 34 deletions
diff --git a/src/batch.hpp b/src/batch.hpp index 39a2a25..958898e 100644 --- a/src/batch.hpp +++ b/src/batch.hpp @@ -10,39 +10,43 @@ // std libs #include <vector> -class Batch + +namespace Ogle { - public: - unsigned int VAO, VBO, EBO; - std::vector<float> vertices = {}; - std::vector<unsigned int> indices = {}; - unsigned int size, batch_limit; - unsigned int last_texture = 0; + class Batch + { + public: + unsigned int VAO, VBO, EBO; + std::vector<float> vertices = {}; + std::vector<unsigned int> indices = {}; + unsigned int size, batch_limit; + unsigned int last_texture = 0; - Batch(unsigned int batch_limit = 8192); - int drawTexture( - Texture texture, - float x, - float y, - float width, - float height, - glm::vec4 color - ); - int drawRectangle( - float x, - float y, - float width, - float height, - glm::vec4 color - ); - void flush(); - private: - int primativeDrawQuad( - unsigned int texture_id, - glm::vec3 a, - glm::vec3 b, - glm::vec3 c, - glm::vec3 d, - glm::vec4 color - ); -}; + Batch(unsigned int batch_limit = 8192); + int drawTexture( + Texture texture, + float x, + float y, + float width, + float height, + glm::vec4 color + ); + int drawRectangle( + float x, + float y, + float width, + float height, + glm::vec4 color + ); + void flush(); + private: + int primativeDrawQuad( + unsigned int texture_id, + glm::vec3 a, + glm::vec3 b, + glm::vec3 c, + glm::vec3 d, + glm::vec4 color + ); + }; +} |
