aboutsummaryrefslogtreecommitdiffstats
path: root/yage/render/spritebatch.h
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-12-30 16:07:41 +0000
committerYann Herklotz <ymherklotz@gmail.com>2017-12-30 16:07:41 +0000
commit5c1a57b3672ec1e0777d8d0878c6a7ae93ebfdca (patch)
tree4a7da71cdc548867aad8bbea45827effb80df527 /yage/render/spritebatch.h
parentd2ed94a517066da4f4ec53045f9c69bfc355eab6 (diff)
downloadYAGE-5c1a57b3672ec1e0777d8d0878c6a7ae93ebfdca.tar.gz
YAGE-5c1a57b3672ec1e0777d8d0878c6a7ae93ebfdca.zip
[Code] Fixed spritebatch and optimised it.
Diffstat (limited to 'yage/render/spritebatch.h')
-rw-r--r--yage/render/spritebatch.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/yage/render/spritebatch.h b/yage/render/spritebatch.h
index e82268b8..35d9a1b1 100644
--- a/yage/render/spritebatch.h
+++ b/yage/render/spritebatch.h
@@ -9,9 +9,9 @@
#ifndef YAGE_SPRITE_BATCH_H
#define YAGE_SPRITE_BATCH_H
-#include "batch.h"
-#include "../data/vertex.h"
#include "../data/renderbatch.h"
+#include "../data/vertex.h"
+#include "batch.h"
#include <glad/glad.h>
#include <glm/glm.hpp>
@@ -48,15 +48,14 @@ public:
Vertex bottom_left() const { return bottom_left_; }
};
-
class SpriteBatch
{
public:
static const int NUM_VERTICES = 6;
private:
- GLuint vbo_ = 0;
- GLuint vao_ = 0;
+ GLuint vao_;
+ GLuint vbo_;
std::vector<Glyph> glyphs_;
std::vector<Glyph *> glyph_ptrs_;
std::vector<RenderBatch> render_batches_;
@@ -81,7 +80,6 @@ public:
void render();
private:
- void createVertexArray();
void createRenderBatches();
void sortGlyphs();
};