9 #ifndef SPRITE_BATCH_HPP 10 #define SPRITE_BATCH_HPP 15 #include <glm/glm.hpp> 37 Glyph(GLuint texture,
float depth,
const Vertex &top_left,
const Vertex &top_right,
const Vertex &bottom_right,
const Vertex &bottom_left);
39 inline GLuint texture()
const {
return texture_; }
40 inline float depth()
const {
return depth_; }
41 inline Vertex top_left()
const {
return top_left_; }
42 inline Vertex top_right()
const {
return top_right_; }
43 inline Vertex bottom_right()
const {
return bottom_right_; }
44 inline Vertex bottom_left()
const {
return bottom_left_; }
52 GLsizei num_vertices_;
58 RenderBatch(GLint offset, GLsizei num_vertices, GLuint texture);
61 inline GLint offset()
const {
return offset_; }
62 inline GLsizei num_vertices()
const {
return num_vertices_; }
63 inline GLuint texture()
const {
return texture_; }
70 static const int NUM_VERTICES=6;
74 std::vector<Glyph> glyphs_;
75 std::vector<Glyph *> glyph_ptrs_;
76 std::vector<RenderBatch> render_batches_;
88 void draw(
const glm::vec4 &destination_rect,
const glm::vec4 &uv_rect, GLuint texture,
const Color &color,
float depth);
92 void createVertexArray();
93 void createRenderBatches();
Definition: camera2d.hpp:17