diff options
| author | realtradam <[email protected]> | 2022-11-26 16:46:01 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-11-26 16:46:01 -0500 |
| commit | 368269070f851ff78a1bce35c1d993d5f02cc5f9 (patch) | |
| tree | 83292448b320f561148f16efdbb456c85ab00f87 /src/batch.hpp | |
| parent | 68486053b032fd3313c887ea7d73064e59dce570 (diff) | |
| download | Ogle-368269070f851ff78a1bce35c1d993d5f02cc5f9.tar.gz Ogle-368269070f851ff78a1bce35c1d993d5f02cc5f9.zip | |
namespace it all
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 + ); + }; +} |
