From 9fb4ab106f17290faf65146d4b005885507c1900 Mon Sep 17 00:00:00 2001 From: TravisBot <> Date: Sat, 19 May 2018 14:24:37 +0000 Subject: [Travis] Rebuilding documentation --- spritebatch_8h_source.html | 198 ++++++++++++++++++++++----------------------- 1 file changed, 98 insertions(+), 100 deletions(-) (limited to 'spritebatch_8h_source.html') diff --git a/spritebatch_8h_source.html b/spritebatch_8h_source.html index c0562afe..c9afc912 100644 --- a/spritebatch_8h_source.html +++ b/spritebatch_8h_source.html @@ -95,118 +95,116 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
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 details
-
24 {
-
25 
-
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;
-
42  Vertex top_left;
-
43  Vertex top_right;
-
44  Vertex bottom_right;
-
45  Vertex bottom_left;
-
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 } // namespace details
-
58 
-
59 class SpriteBatch
-
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 } // namespace yage
-
96 
-
97 #endif
+
13 
+
14 #include <glad/glad.h>
+
15 #include <glm/glm.hpp>
+
16 
+
17 #include <vector>
+
18 
+
19 namespace yage
+
20 {
+
21 
+
22 namespace details
+
23 {
+
24 
+
25 struct RenderBatch {
+
26  GLint offset;
+
27  GLsizei num_vertices;
+
28  GLuint texture;
+
29 
+
30  RenderBatch(GLint offset_i, GLsizei num_vertices_i, GLuint texture_i)
+
31  : offset(offset_i), num_vertices(num_vertices_i), texture(texture_i)
+
32  {
+
33  }
+
34 };
+
35 
+
38 struct Glyph {
+
39  GLuint texture;
+
40  float depth;
+
41  Vertex top_left;
+
42  Vertex top_right;
+
43  Vertex bottom_right;
+
44  Vertex bottom_left;
+
45 
+
46  Glyph(GLuint texture_i, float depth_i, const Vertex &top_left_i,
+
47  const Vertex &top_right_i, const Vertex &bottom_right_i,
+
48  const Vertex &bottom_left_i)
+
49  : texture(texture_i), depth(depth_i), top_left(top_left_i),
+
50  top_right(top_right_i), bottom_right(bottom_right_i),
+
51  bottom_left(bottom_left_i)
+
52  {
+
53  }
+
54 };
+
55 
+
56 } // namespace details
+
57 
+
58 class SpriteBatch
+
59 {
+
60 public:
+
61  static const int NUM_VERTICES = 6;
+
62 
+
63 private:
+
64  GLuint vao_;
+
65  GLuint vbo_;
+
66  std::vector<details::Glyph> glyphs_;
+
67  std::vector<details::Glyph *> glyph_ptrs_;
+
68  std::vector<details::RenderBatch> render_batches_;
+
69 
+
70 public:
+
71  SpriteBatch();
+
72  SpriteBatch(const SpriteBatch &) = delete;
+
73  SpriteBatch(SpriteBatch &&) = delete;
+
74  ~SpriteBatch();
+
75 
+
76  SpriteBatch &operator=(const SpriteBatch &) = delete;
+
77  SpriteBatch &operator=(SpriteBatch &&) = delete;
+
78 
+
79  // initialize vaos and vbos
+
80  void begin();
+
81  void end();
+
82 
+
83  // adds a sprite to the sprite batch to be rendered later
+
84  void draw(const glm::vec4 &destination_rect, const glm::vec4 &uv_rect,
+
85  GLuint texture, const Colour &colour, float depth);
+
86  // render the batch
+
87  void render();
+
88 
+
89 private:
+
90  void createRenderBatches();
+
91  void sortGlyphs();
+
92 };
+
93 
+
94 } // namespace yage
+
95 
+
96 #endif
yage::SpriteBatch::draw
void draw(const glm::vec4 &destination_rect, const glm::vec4 &uv_rect, GLuint texture, const Colour &colour, float depth)
Definition: spritebatch.cpp:78
-
yage::details::RenderBatch::texture
GLuint texture
Definition: spritebatch.h:29
+
yage::details::RenderBatch::texture
GLuint texture
Definition: spritebatch.h:28
yage::SpriteBatch::end
void end()
Definition: spritebatch.cpp:72
yage::Vertex
Definition: vertex.h:49
-
yage::details::Glyph::Glyph
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
-
yage::SpriteBatch
Definition: spritebatch.h:59
-
yage::details::Glyph::texture
GLuint texture
Definition: spritebatch.h:40
+
yage::details::Glyph::Glyph
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:46
+
yage::SpriteBatch
Definition: spritebatch.h:58
+
yage::details::Glyph::texture
GLuint texture
Definition: spritebatch.h:39
yage::SpriteBatch::begin
void begin()
Definition: spritebatch.cpp:65
-
yage::details::Glyph::bottom_left
Vertex bottom_left
Definition: spritebatch.h:45
+
yage::details::Glyph::bottom_left
Vertex bottom_left
Definition: spritebatch.h:44
yage::SpriteBatch::render
void render()
Definition: spritebatch.cpp:108
-
yage::details::Glyph::bottom_right
Vertex bottom_right
Definition: spritebatch.h:44
+
yage::details::Glyph::bottom_right
Vertex bottom_right
Definition: spritebatch.h:43
yage::SpriteBatch::operator=
SpriteBatch & operator=(const SpriteBatch &)=delete
-
yage::details::Glyph::top_left
Vertex top_left
Definition: spritebatch.h:42
-
yage::details::RenderBatch::RenderBatch
RenderBatch(GLint offset_i, GLsizei num_vertices_i, GLuint texture_i)
Definition: spritebatch.h:31
-
yage::details::RenderBatch::offset
GLint offset
Definition: spritebatch.h:27
-
yage::SpriteBatch::NUM_VERTICES
static const int NUM_VERTICES
Definition: spritebatch.h:62
-
yage::details::RenderBatch
Definition: spritebatch.h:26
+
yage::details::Glyph::top_left
Vertex top_left
Definition: spritebatch.h:41
+
yage::details::RenderBatch::RenderBatch
RenderBatch(GLint offset_i, GLsizei num_vertices_i, GLuint texture_i)
Definition: spritebatch.h:30
+
yage::details::RenderBatch::offset
GLint offset
Definition: spritebatch.h:26
+
yage::SpriteBatch::NUM_VERTICES
static const int NUM_VERTICES
Definition: spritebatch.h:61
+
yage::details::RenderBatch
Definition: spritebatch.h:25
yage::SpriteBatch::SpriteBatch
SpriteBatch()
Definition: spritebatch.cpp:25
-
yage::details::Glyph::depth
float depth
Definition: spritebatch.h:41
+
yage::details::Glyph::depth
float depth
Definition: spritebatch.h:40
yage::Colour
Definition: vertex.h:26
-
yage::details::Glyph::top_right
Vertex top_right
Definition: spritebatch.h:43
-
batch.h
-
yage::details::Glyph
Glyph with information of the texture.
Definition: spritebatch.h:39
-
yage::details::RenderBatch::num_vertices
GLsizei num_vertices
Definition: spritebatch.h:28
+
yage::details::Glyph::top_right
Vertex top_right
Definition: spritebatch.h:42
+
yage::details::Glyph
Glyph with information of the texture.
Definition: spritebatch.h:38
+
yage::details::RenderBatch::num_vertices
GLsizei num_vertices
Definition: spritebatch.h:27
yage::SpriteBatch::~SpriteBatch
~SpriteBatch()
Definition: spritebatch.cpp:55
-- cgit