-
12 #ifndef YAGE_SPRITE_BATCH_H
-
13 #define YAGE_SPRITE_BATCH_H
-
-
-
-
17 #include <glad/glad.h>
-
18 #include <glm/glm.hpp>
-
-
-
+
9 #ifndef YAGE_SPRITE_BATCH_H
+
10 #define YAGE_SPRITE_BATCH_H
+
+
12 #include "../data/vertex.h"
+
+
+
15 #include <glad/glad.h>
+
16 #include <glm/glm.hpp>
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
31 RenderBatch(GLint offset_i, GLsizei num_vertices_i, GLuint texture_i)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
47 Glyph(GLuint texture_i,
float depth_i,
const Vertex &top_left_i,
+
+
49 const Vertex &bottom_left_i)
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
67 std::vector<details::Glyph> glyphs_;
+
68 std::vector<details::Glyph *> glyph_ptrs_;
+
69 std::vector<details::RenderBatch> render_batches_;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
85 void draw(
const glm::vec4 &destination_rect,
const glm::vec4 &uv_rect,
+
86 GLuint texture,
const Colour &colour,
float depth);
+
+
+
+
+
91 void createRenderBatches();
+
+
-
-
-
-
98 const Colour &colour,
float depth);
-
-
-
-
-
-
-
-
-
-
-
-
-
Definition: spritebatch.h:53
-
std::vector< Glyph * > glyph_ptrs_
Definition: spritebatch.h:79
-
GLuint texture_
Definition: spritebatch.h:60
-
Vertex bottom_left_
Definition: spritebatch.h:38
-
void end()
Definition: spritebatch.cpp:56
+
+
+
+
void draw(const glm::vec4 &destination_rect, const glm::vec4 &uv_rect, GLuint texture, const Colour &colour, float depth)
Definition: spritebatch.cpp:78
+
GLuint texture
Definition: spritebatch.h:29
+
void end()
Definition: spritebatch.cpp:72
-
Definition: spritebatch.h:70
-
Vertex bottom_right() const
Definition: spritebatch.h:49
-
void createVertexArray()
Definition: spritebatch.cpp:112
-
void begin()
Definition: spritebatch.cpp:49
-
Vertex top_left_
Definition: spritebatch.h:35
-
Vertex bottom_left() const
Definition: spritebatch.h:50
-
void render()
Definition: spritebatch.cpp:93
+
Glyph(GLuint texture_i, float depth_i, const Vertex &top_left_i, const Vertex &top_right_i, const Vertex &bottom_right_i, const Vertex &bottom_left_i)
Definition: spritebatch.h:47
+
Definition: spritebatch.h:59
+
GLuint texture
Definition: spritebatch.h:40
+
void begin()
Definition: spritebatch.cpp:65
+
Vertex bottom_left
Definition: spritebatch.h:45
+
void render()
Definition: spritebatch.cpp:108
+
Vertex bottom_right
Definition: spritebatch.h:44
SpriteBatch & operator=(const SpriteBatch &)=delete
-
Glyph(GLuint texture, float depth, const Vertex &top_left, const Vertex &top_right, const Vertex &bottom_right, const Vertex &bottom_left)
Definition: spritebatch.cpp:19
-
GLuint vbo_
Definition: spritebatch.h:76
-
float depth_
Definition: spritebatch.h:34
-
GLint offset() const
Definition: spritebatch.h:65
-
-
friend SpriteBatch
Definition: spritebatch.h:55
-
void createRenderBatches()
Definition: spritebatch.cpp:150
-
-
GLuint texture_
Definition: spritebatch.h:33
-
float depth() const
Definition: spritebatch.h:46
-
Vertex bottom_right_
Definition: spritebatch.h:37
-
static const int NUM_VERTICES
Definition: spritebatch.h:73
-
void draw(const yage::Vector4f &destination_rect, const yage::Vector4f &uv_rect, GLuint texture, const Colour &colour, float depth)
Definition: spritebatch.cpp:62
-
GLuint vao_
Definition: spritebatch.h:77
-
GLuint texture() const
Definition: spritebatch.h:45
-
std::vector< RenderBatch > render_batches_
Definition: spritebatch.h:80
-
std::vector< Glyph > glyphs_
Definition: spritebatch.h:78
-
SpriteBatch()
Definition: spritebatch.cpp:33
-
GLint offset_
Definition: spritebatch.h:59
+
Vertex top_left
Definition: spritebatch.h:42
+
RenderBatch(GLint offset_i, GLsizei num_vertices_i, GLuint texture_i)
Definition: spritebatch.h:31
+
GLint offset
Definition: spritebatch.h:27
+
static const int NUM_VERTICES
Definition: spritebatch.h:62
+
Definition: spritebatch.h:26
+
SpriteBatch()
Definition: spritebatch.cpp:25
+
float depth
Definition: spritebatch.h:41
-
GLsizei num_vertices() const
Definition: spritebatch.h:66
-
Vertex top_right_
Definition: spritebatch.h:36
-
GLuint texture() const
Definition: spritebatch.h:67
-
void sortGlyphs()
Definition: spritebatch.cpp:188
-
4D Vector class
Definition: matrix.h:376
-
Glyph with information of the texture.
Definition: spritebatch.h:30
-
GLsizei num_vertices_
Definition: spritebatch.h:58
-
RenderBatch(GLint offset, GLsizei num_vertices, GLuint texture)
Definition: spritebatch.cpp:28
-
~SpriteBatch()
Definition: spritebatch.cpp:38
-
Vertex top_left() const
Definition: spritebatch.h:47
-
Vertex top_right() const
Definition: spritebatch.h:48
+
Vertex top_right
Definition: spritebatch.h:43
+
+
Glyph with information of the texture.
Definition: spritebatch.h:39
+
GLsizei num_vertices
Definition: spritebatch.h:28
+
~SpriteBatch()
Definition: spritebatch.cpp:55