9 #ifndef YAGE_SPRITE_BATCH_HPP 10 #define YAGE_SPRITE_BATCH_HPP 15 #include <glm/glm.hpp> 37 Glyph(GLuint texture,
float depth,
const Vertex& top_left,
38 const Vertex& top_right,
const Vertex& bottom_right,
39 const Vertex& bottom_left);
41 GLuint texture()
const {
return texture_; }
42 float depth()
const {
return depth_; }
43 Vertex top_left()
const {
return top_left_; }
44 Vertex top_right()
const {
return top_right_; }
45 Vertex bottom_right()
const {
return bottom_right_; }
46 Vertex bottom_left()
const {
return bottom_left_; }
53 GLsizei num_vertices_;
59 RenderBatch(GLint offset, GLsizei num_vertices, GLuint texture);
66 GLint
offset()
const {
return offset_; }
69 GLuint texture()
const {
return texture_; }
76 static const int NUM_VERTICES = 6;
81 std::vector<Glyph> glyphs_;
82 std::vector<Glyph*> glyph_ptrs_;
83 std::vector<RenderBatch> render_batches_;
88 SpriteBatch(
const SpriteBatch&) =
delete;
89 SpriteBatch(SpriteBatch&&) =
delete;
92 SpriteBatch& operator=(
const SpriteBatch&) =
delete;
93 SpriteBatch& operator=(SpriteBatch&&) =
delete;
100 void draw(
const glm::vec4& destination_rect,
const glm::vec4& uv_rect,
101 GLuint texture,
const Color& color,
float depth);
106 void createVertexArray();
107 void createRenderBatches();
GLsizei num_vertices() const
num_vertices
Definition: spritebatch.hpp:68
Glyph with information of the texture.
Definition: spritebatch.hpp:25
Definition: camera2d.hpp:17
GLint offset() const
Offset.
Definition: spritebatch.hpp:66