From 460d9bda5f03c5da29864fa9dd160848097be51b Mon Sep 17 00:00:00 2001 From: TravisBot <> Date: Sat, 6 Jan 2018 11:36:50 +0000 Subject: [Travis] Rebuilding documentation --- spritebatch_8h_source.html | 244 ++++++++++++++++++++------------------------- 1 file changed, 107 insertions(+), 137 deletions(-) (limited to 'spritebatch_8h_source.html') diff --git a/spritebatch_8h_source.html b/spritebatch_8h_source.html index 28e871ed..b94a9ee5 100644 --- a/spritebatch_8h_source.html +++ b/spritebatch_8h_source.html @@ -4,7 +4,7 @@ -YAGE: yage/core/spritebatch.h Source File +YAGE: yage/render/spritebatch.h Source File @@ -109,155 +109,125 @@ $(document).ready(function(){initNavTree('spritebatch_8h_source.html','');});
Go to the documentation of this file.
1 
-
12 #ifndef YAGE_SPRITE_BATCH_H
-
13 #define YAGE_SPRITE_BATCH_H
-
14 
-
15 #include "vertex.h"
-
16 
-
17 #include <glad/glad.h>
-
18 #include <glm/glm.hpp>
-
19 #include <yage/math/matrix.h>
-
20 
-
21 #include <vector>
+
9 #ifndef YAGE_SPRITE_BATCH_H
+
10 #define YAGE_SPRITE_BATCH_H
+
11 
+
12 #include "../data/vertex.h"
+
13 #include "batch.h"
+
14 
+
15 #include <glad/glad.h>
+
16 #include <glm/glm.hpp>
+
17 
+
18 #include <vector>
+
19 
+
20 namespace yage
+
21 {
22 
-
23 namespace yage
+
23 namespace details
24 {
25 
-
26 class SpriteBatch;
-
27 
-
30 class Glyph
-
31 {
-
32 private:
-
33  GLuint texture_;
-
34  float depth_;
- - - - -
39 
-
40 public:
-
41  Glyph(GLuint texture, float depth, const Vertex &top_left,
-
42  const Vertex &top_right, const Vertex &bottom_right,
-
43  const Vertex &bottom_left);
-
44 
-
45  GLuint texture() const { return texture_; }
-
46  float depth() const { return depth_; }
-
47  Vertex top_left() const { return top_left_; }
-
48  Vertex top_right() const { return top_right_; }
-
49  Vertex bottom_right() const { return bottom_right_; }
-
50  Vertex bottom_left() const { return bottom_left_; }
-
51 };
-
52 
- -
54 {
-
55  friend SpriteBatch;
+
26 struct RenderBatch {
+
27  GLint offset;
+
28  GLsizei num_vertices;
+
29  GLuint texture;
+
30 
+
31  RenderBatch(GLint offset_i, GLsizei num_vertices_i, GLuint texture_i)
+
32  : offset(offset_i), num_vertices(num_vertices_i), texture(texture_i)
+
33  {
+
34  }
+
35 };
+
36 
+
39 struct Glyph {
+
40  GLuint texture;
+
41  float depth;
+ + + + +
46 
+
47  Glyph(GLuint texture_i, float depth_i, const Vertex &top_left_i,
+
48  const Vertex &top_right_i, const Vertex &bottom_right_i,
+
49  const Vertex &bottom_left_i)
+
50  : texture(texture_i), depth(depth_i), top_left(top_left_i),
+
51  top_right(top_right_i), bottom_right(bottom_right_i),
+
52  bottom_left(bottom_left_i)
+
53  {
+
54  }
+
55 };
56 
-
57 private:
-
58  GLsizei num_vertices_;
-
59  GLint offset_;
-
60  GLuint texture_;
-
61 
-
62 public:
-
63  RenderBatch(GLint offset, GLsizei num_vertices, GLuint texture);
-
64 
-
65  GLint offset() const { return offset_; }
-
66  GLsizei num_vertices() const { return num_vertices_; }
-
67  GLuint texture() const { return texture_; }
-
68 };
-
69 
- -
71 {
-
72 public:
-
73  static const int NUM_VERTICES = 6;
-
74 
-
75 private:
-
76  GLuint vbo_ = 0;
-
77  GLuint vao_ = 0;
-
78  std::vector<Glyph> glyphs_;
-
79  std::vector<Glyph *> glyph_ptrs_;
-
80  std::vector<RenderBatch> render_batches_;
-
81 
-
82 public:
-
83  SpriteBatch();
-
84  SpriteBatch(const SpriteBatch &) = delete;
-
85  SpriteBatch(SpriteBatch &&) = delete;
-
86  ~SpriteBatch();
-
87 
-
88  SpriteBatch &operator=(const SpriteBatch &) = delete;
-
89  SpriteBatch &operator=(SpriteBatch &&) = delete;
-
90 
-
91  // initialize vaos and vbos
-
92  void begin();
-
93  void end();
+
57 } // namespace details
+
58 
+ +
60 {
+
61 public:
+
62  static const int NUM_VERTICES = 6;
+
63 
+
64 private:
+
65  GLuint vao_;
+
66  GLuint vbo_;
+
67  std::vector<details::Glyph> glyphs_;
+
68  std::vector<details::Glyph *> glyph_ptrs_;
+
69  std::vector<details::RenderBatch> render_batches_;
+
70 
+
71 public:
+
72  SpriteBatch();
+
73  SpriteBatch(const SpriteBatch &) = delete;
+
74  SpriteBatch(SpriteBatch &&) = delete;
+
75  ~SpriteBatch();
+
76 
+
77  SpriteBatch &operator=(const SpriteBatch &) = delete;
+
78  SpriteBatch &operator=(SpriteBatch &&) = delete;
+
79 
+
80  // initialize vaos and vbos
+
81  void begin();
+
82  void end();
+
83 
+
84  // adds a sprite to the sprite batch to be rendered later
+
85  void draw(const glm::vec4 &destination_rect, const glm::vec4 &uv_rect,
+
86  GLuint texture, const Colour &colour, float depth);
+
87  // render the batch
+
88  void render();
+
89 
+
90 private:
+
91  void createRenderBatches();
+
92  void sortGlyphs();
+
93 };
94 
-
95  // adds a sprite to the sprite batch to be rendered later
-
96  void draw(const yage::Vector4f &destination_rect,
-
97  const yage::Vector4f &uv_rect, GLuint texture,
-
98  const Colour &colour, float depth);
-
99  // render the batch
-
100  void render();
-
101 
-
102 private:
-
103  void createVertexArray();
-
104  void createRenderBatches();
-
105  void sortGlyphs();
-
106 };
-
107 
-
108 } // namespace yage
-
109 
-
110 #endif
-
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
+
95 } // namespace yage
+
96 
+
97 #endif
+
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: vertex.h:49
-
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
Definition: vertex.h:26
-
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