From e8b49088a03f58ebfd47a3c564e8cb81c6839f7c Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sun, 13 Aug 2017 17:40:57 +0100 Subject: Updating docs --- annotated.html | 2 +- body_8hpp_source.html | 2 +- camera2d_8hpp_source.html | 2 +- classes.html | 2 +- classyage_1_1Glyph-members.html | 2 +- classyage_1_1Glyph.html | 2 +- classyage_1_1Matrix-members.html | 2 +- classyage_1_1Matrix.html | 2 +- classyage_1_1Vector2-members.html | 2 +- classyage_1_1Vector2.html | 2 +- collider_8hpp_source.html | 2 +- collisionbody_8hpp_source.html | 2 +- dir_5ac3a90c14a160db9539610948ce4998.html | 2 +- dir_68267d1309a1af8e8297ef4c3efbcdba.html | 2 +- dir_b233a2caca2b45d5ef987dbbf49782d0.html | 2 +- dir_d44c64559bbebec7f509842c48db8b23.html | 2 +- dir_f562165b51c585c003877be645f219b5.html | 2 +- files.html | 2 +- functions.html | 2 +- functions_func.html | 2 +- functions_vars.html | 2 +- glslprogram_8hpp_source.html | 2 +- group__getters.html | 2 +- hierarchy.html | 2 +- imageloader_8hpp_source.html | 2 +- index.html | 2 +- inputmanager_8hpp_source.html | 2 +- iomanager_8hpp_source.html | 2 +- math_8hpp_source.html | 2 +- matrix_8hpp.html | 2 +- matrix_8hpp_source.html | 2 +- md_README.html | 2 +- md_docs_README.html | 2 +- modules.html | 2 +- namespacemembers.html | 2 +- namespacemembers_func.html | 2 +- namespaces.html | 2 +- namespaceyage_1_1matrix.html | 2 +- pages.html | 2 +- particlebody_8hpp_source.html | 2 +- physics_8hpp_source.html | 2 +- picopng_8hpp_source.html | 2 +- rectanglecollider_8hpp_source.html | 2 +- resourcemanager_8hpp_source.html | 2 +- rigidbody_8hpp_source.html | 2 +- sprite_8hpp_source.html | 2 +- spritebatch_8hpp_source.html | 4 ++-- texture_8hpp_source.html | 2 +- texturecache_8hpp_source.html | 2 +- vertex_8hpp_source.html | 2 +- window_8hpp_source.html | 2 +- yage_8hpp_source.html | 2 +- 52 files changed, 53 insertions(+), 53 deletions(-) diff --git a/annotated.html b/annotated.html index f87db39d..bcc1b691 100644 --- a/annotated.html +++ b/annotated.html @@ -75,7 +75,7 @@ $(function() { diff --git a/body_8hpp_source.html b/body_8hpp_source.html index 4a4faa22..816f79a6 100644 --- a/body_8hpp_source.html +++ b/body_8hpp_source.html @@ -74,7 +74,7 @@ $(function() { diff --git a/camera2d_8hpp_source.html b/camera2d_8hpp_source.html index 62b052f7..faeda50d 100644 --- a/camera2d_8hpp_source.html +++ b/camera2d_8hpp_source.html @@ -72,7 +72,7 @@ $(function() { diff --git a/classes.html b/classes.html index 11d168a6..1d07bcc1 100644 --- a/classes.html +++ b/classes.html @@ -78,7 +78,7 @@ $(function() { diff --git a/classyage_1_1Glyph-members.html b/classyage_1_1Glyph-members.html index 679385e6..e1fe04f0 100644 --- a/classyage_1_1Glyph-members.html +++ b/classyage_1_1Glyph-members.html @@ -74,7 +74,7 @@ $(function() { diff --git a/classyage_1_1Glyph.html b/classyage_1_1Glyph.html index 252a1514..1bb74e21 100644 --- a/classyage_1_1Glyph.html +++ b/classyage_1_1Glyph.html @@ -84,7 +84,7 @@ $(function() { diff --git a/classyage_1_1Matrix-members.html b/classyage_1_1Matrix-members.html index 78bb2b90..d66ad3ec 100644 --- a/classyage_1_1Matrix-members.html +++ b/classyage_1_1Matrix-members.html @@ -79,7 +79,7 @@ $(function() { diff --git a/classyage_1_1Matrix.html b/classyage_1_1Matrix.html index a7e87954..af6f727b 100644 --- a/classyage_1_1Matrix.html +++ b/classyage_1_1Matrix.html @@ -154,7 +154,7 @@ template<int Rows = 4, int Cols = 4, class Type = double> diff --git a/classyage_1_1Vector2-members.html b/classyage_1_1Vector2-members.html index 117d4683..560c183f 100644 --- a/classyage_1_1Vector2-members.html +++ b/classyage_1_1Vector2-members.html @@ -79,7 +79,7 @@ $(function() { diff --git a/classyage_1_1Vector2.html b/classyage_1_1Vector2.html index 7d3ee386..5a14bd61 100644 --- a/classyage_1_1Vector2.html +++ b/classyage_1_1Vector2.html @@ -89,7 +89,7 @@ class yage::Vector2< Type > diff --git a/collider_8hpp_source.html b/collider_8hpp_source.html index 820b0712..18496647 100644 --- a/collider_8hpp_source.html +++ b/collider_8hpp_source.html @@ -72,7 +72,7 @@ $(function() { diff --git a/collisionbody_8hpp_source.html b/collisionbody_8hpp_source.html index 3e88cc8c..d57ebed3 100644 --- a/collisionbody_8hpp_source.html +++ b/collisionbody_8hpp_source.html @@ -72,7 +72,7 @@ $(function() { diff --git a/dir_5ac3a90c14a160db9539610948ce4998.html b/dir_5ac3a90c14a160db9539610948ce4998.html index 987b240f..433627c4 100644 --- a/dir_5ac3a90c14a160db9539610948ce4998.html +++ b/dir_5ac3a90c14a160db9539610948ce4998.html @@ -78,7 +78,7 @@ Files diff --git a/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/dir_68267d1309a1af8e8297ef4c3efbcdba.html index 97a9095d..021d9cfa 100644 --- a/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ b/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -71,7 +71,7 @@ $(function() { diff --git a/dir_b233a2caca2b45d5ef987dbbf49782d0.html b/dir_b233a2caca2b45d5ef987dbbf49782d0.html index 46b92c98..35677b2e 100644 --- a/dir_b233a2caca2b45d5ef987dbbf49782d0.html +++ b/dir_b233a2caca2b45d5ef987dbbf49782d0.html @@ -71,7 +71,7 @@ $(function() { diff --git a/dir_d44c64559bbebec7f509842c48db8b23.html b/dir_d44c64559bbebec7f509842c48db8b23.html index ccf292aa..fd6b61d8 100644 --- a/dir_d44c64559bbebec7f509842c48db8b23.html +++ b/dir_d44c64559bbebec7f509842c48db8b23.html @@ -75,7 +75,7 @@ Directories diff --git a/dir_f562165b51c585c003877be645f219b5.html b/dir_f562165b51c585c003877be645f219b5.html index f2b23a5c..38855e9a 100644 --- a/dir_f562165b51c585c003877be645f219b5.html +++ b/dir_f562165b51c585c003877be645f219b5.html @@ -75,7 +75,7 @@ Directories diff --git a/files.html b/files.html index 37ef7441..131ab711 100644 --- a/files.html +++ b/files.html @@ -98,7 +98,7 @@ $(function() { diff --git a/functions.html b/functions.html index 53093eb2..2791238e 100644 --- a/functions.html +++ b/functions.html @@ -80,7 +80,7 @@ $(function() { diff --git a/functions_func.html b/functions_func.html index f4986c3a..023f1806 100644 --- a/functions_func.html +++ b/functions_func.html @@ -77,7 +77,7 @@ $(function() { diff --git a/functions_vars.html b/functions_vars.html index 320cc8aa..4d58f59d 100644 --- a/functions_vars.html +++ b/functions_vars.html @@ -68,7 +68,7 @@ $(function() { diff --git a/glslprogram_8hpp_source.html b/glslprogram_8hpp_source.html index 31168026..512e54d8 100644 --- a/glslprogram_8hpp_source.html +++ b/glslprogram_8hpp_source.html @@ -72,7 +72,7 @@ $(function() { diff --git a/group__getters.html b/group__getters.html index 48c1fd13..276ca2c7 100644 --- a/group__getters.html +++ b/group__getters.html @@ -68,7 +68,7 @@ $(function() { diff --git a/hierarchy.html b/hierarchy.html index 923a0087..580f310e 100644 --- a/hierarchy.html +++ b/hierarchy.html @@ -77,7 +77,7 @@ $(function() { diff --git a/imageloader_8hpp_source.html b/imageloader_8hpp_source.html index 6c0cbedd..9787c1e4 100644 --- a/imageloader_8hpp_source.html +++ b/imageloader_8hpp_source.html @@ -72,7 +72,7 @@ $(function() { diff --git a/index.html b/index.html index 49764fc2..63e30769 100644 --- a/index.html +++ b/index.html @@ -67,7 +67,7 @@ $(function() { diff --git a/inputmanager_8hpp_source.html b/inputmanager_8hpp_source.html index 81f36ced..49466af6 100644 --- a/inputmanager_8hpp_source.html +++ b/inputmanager_8hpp_source.html @@ -72,7 +72,7 @@ $(function() { diff --git a/iomanager_8hpp_source.html b/iomanager_8hpp_source.html index ac1cfb8d..e0313ad9 100644 --- a/iomanager_8hpp_source.html +++ b/iomanager_8hpp_source.html @@ -72,7 +72,7 @@ $(function() { diff --git a/math_8hpp_source.html b/math_8hpp_source.html index 6cf8a9d0..451f8eba 100644 --- a/math_8hpp_source.html +++ b/math_8hpp_source.html @@ -72,7 +72,7 @@ $(function() { diff --git a/matrix_8hpp.html b/matrix_8hpp.html index a69866e8..879a0814 100644 --- a/matrix_8hpp.html +++ b/matrix_8hpp.html @@ -132,7 +132,7 @@ Functions diff --git a/matrix_8hpp_source.html b/matrix_8hpp_source.html index 26233d2f..234babd9 100644 --- a/matrix_8hpp_source.html +++ b/matrix_8hpp_source.html @@ -81,7 +81,7 @@ $(function() { diff --git a/md_README.html b/md_README.html index 5698ab71..e67e28e5 100644 --- a/md_README.html +++ b/md_README.html @@ -70,7 +70,7 @@ $(function() { diff --git a/md_docs_README.html b/md_docs_README.html index 7dbc805d..38c8adec 100644 --- a/md_docs_README.html +++ b/md_docs_README.html @@ -68,7 +68,7 @@ $(function() { diff --git a/modules.html b/modules.html index 3ef0e2db..8e74d9fd 100644 --- a/modules.html +++ b/modules.html @@ -72,7 +72,7 @@ $(function() { diff --git a/namespacemembers.html b/namespacemembers.html index 83ec0c77..d58fb4cc 100644 --- a/namespacemembers.html +++ b/namespacemembers.html @@ -74,7 +74,7 @@ $(function() { diff --git a/namespacemembers_func.html b/namespacemembers_func.html index d9a099d5..ad01a731 100644 --- a/namespacemembers_func.html +++ b/namespacemembers_func.html @@ -74,7 +74,7 @@ $(function() { diff --git a/namespaces.html b/namespaces.html index 4b92ebe7..eeccb508 100644 --- a/namespaces.html +++ b/namespaces.html @@ -73,7 +73,7 @@ $(function() { diff --git a/namespaceyage_1_1matrix.html b/namespaceyage_1_1matrix.html index f7898859..fc0c0f42 100644 --- a/namespaceyage_1_1matrix.html +++ b/namespaceyage_1_1matrix.html @@ -200,7 +200,7 @@ template<int M, int N, class T > diff --git a/pages.html b/pages.html index e24c0eaf..7353de45 100644 --- a/pages.html +++ b/pages.html @@ -73,7 +73,7 @@ $(function() { diff --git a/particlebody_8hpp_source.html b/particlebody_8hpp_source.html index 43b55b36..68250082 100644 --- a/particlebody_8hpp_source.html +++ b/particlebody_8hpp_source.html @@ -74,7 +74,7 @@ $(function() { diff --git a/physics_8hpp_source.html b/physics_8hpp_source.html index 1bb17110..51ddae2c 100644 --- a/physics_8hpp_source.html +++ b/physics_8hpp_source.html @@ -71,7 +71,7 @@ $(function() {
1 /* ----------------------------------------------------------------------------
2  * physics.hpp
3  *
4  * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> -- MIT License
5  * See file LICENSE for more details
6  * ----------------------------------------------------------------------------
7  */
8 
9 #ifndef YAGE_PHYSICS_HPP
10 #define YAGE_PHYSICS_HPP
11 
12 #include "body.hpp"
13 #include "collider.hpp"
14 #include "collisionbody.hpp"
15 #include "particlebody.hpp"
16 #include "rectanglecollider.hpp"
17 #include "rigidbody.hpp"
18 
19 #endif
diff --git a/picopng_8hpp_source.html b/picopng_8hpp_source.html index 5df913f1..ffeea553 100644 --- a/picopng_8hpp_source.html +++ b/picopng_8hpp_source.html @@ -72,7 +72,7 @@ $(function() { diff --git a/rectanglecollider_8hpp_source.html b/rectanglecollider_8hpp_source.html index 26aab10d..ccd9b8c0 100644 --- a/rectanglecollider_8hpp_source.html +++ b/rectanglecollider_8hpp_source.html @@ -72,7 +72,7 @@ $(function() { diff --git a/resourcemanager_8hpp_source.html b/resourcemanager_8hpp_source.html index c7ba8148..88348a12 100644 --- a/resourcemanager_8hpp_source.html +++ b/resourcemanager_8hpp_source.html @@ -72,7 +72,7 @@ $(function() { diff --git a/rigidbody_8hpp_source.html b/rigidbody_8hpp_source.html index baacb7a1..6cdd2938 100644 --- a/rigidbody_8hpp_source.html +++ b/rigidbody_8hpp_source.html @@ -73,7 +73,7 @@ $(function() { diff --git a/sprite_8hpp_source.html b/sprite_8hpp_source.html index b27ebbec..58a1b957 100644 --- a/sprite_8hpp_source.html +++ b/sprite_8hpp_source.html @@ -72,7 +72,7 @@ $(function() { diff --git a/spritebatch_8hpp_source.html b/spritebatch_8hpp_source.html index 6a16a174..91b39ed0 100644 --- a/spritebatch_8hpp_source.html +++ b/spritebatch_8hpp_source.html @@ -68,12 +68,12 @@ $(function() {
spritebatch.hpp
-
1 /* ----------------------------------------------------------------------------
2  * spritebatch.hpp
3  *
4  * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> -- MIT License
5  * See file LICENSE for more details
6  * ----------------------------------------------------------------------------
7  */
8 
9 #ifndef YAGE_SPRITE_BATCH_HPP
10 #define YAGE_SPRITE_BATCH_HPP
11 
12 #include "vertex.hpp"
13 
14 #include <GL/glew.h>
15 #include <glm/glm.hpp>
16 
17 #include <vector>
18 
19 namespace yage {
20 
21 class SpriteBatch;
22 
25 class Glyph {
26  // member variables
27 private:
28  GLuint texture_;
29  float depth_;
30  Vertex top_left_;
31  Vertex top_right_;
32  Vertex bottom_right_;
33  Vertex bottom_left_;
34 
35  // member functions
36 public:
37  Glyph(GLuint texture, float depth, const Vertex& top_left,
38  const Vertex& top_right, const Vertex& bottom_right,
39  const Vertex& bottom_left);
40 
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_; }
47 };
48 
49 class RenderBatch {
50  friend SpriteBatch;
51  // member variables
52 private:
53  GLsizei num_vertices_;
54  GLint offset_;
55  GLuint texture_;
56 
57  // member functions
58 public:
59  RenderBatch(GLint offset, GLsizei num_vertices, GLuint texture);
60 
66  GLint offset() const { return offset_; }
67  GLsizei num_vertices() const { return num_vertices_; }
68  GLuint texture() const { return texture_; }
70 };
71 
72 class SpriteBatch {
73  // member variables
74 public:
75  static const int NUM_VERTICES = 6;
76 
77 private:
78  GLuint vbo_ = 0;
79  GLuint vao_ = 0;
80  std::vector<Glyph> glyphs_;
81  std::vector<Glyph*> glyph_ptrs_;
82  std::vector<RenderBatch> render_batches_;
83 
84  // member functions
85 public:
86  SpriteBatch();
87  SpriteBatch(const SpriteBatch&) = delete;
88  SpriteBatch(SpriteBatch&&) = delete;
89  ~SpriteBatch();
90 
91  SpriteBatch& operator=(const SpriteBatch&) = delete;
92  SpriteBatch& operator=(SpriteBatch&&) = delete;
93 
94  // initialize vaos and vbos
95  void init();
96  void begin();
97  void end();
98  // adds a sprite to the sprite batch to be rendered later
99  void draw(const glm::vec4& destination_rect, const glm::vec4& uv_rect,
100  GLuint texture, const Color& color, float depth);
101  // render the batch
102  void render();
103 
104 private:
105  void createVertexArray();
106  void createRenderBatches();
107  void sortGlyphs();
108 };
109 
110 } // yage
111 
112 #endif
Glyph with information of the texture.
Definition: spritebatch.hpp:25
+
1 /* ----------------------------------------------------------------------------
2  * spritebatch.hpp
3  *
4  * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> -- MIT License
5  * See file LICENSE for more details
6  * ----------------------------------------------------------------------------
7  */
8 
9 #ifndef YAGE_SPRITE_BATCH_HPP
10 #define YAGE_SPRITE_BATCH_HPP
11 
12 #include "vertex.hpp"
13 
14 #include <GL/glew.h>
15 #include <glm/glm.hpp>
16 
17 #include <vector>
18 
19 namespace yage {
20 
21 class SpriteBatch;
22 
25 class Glyph {
26  // member variables
27 private:
28  GLuint texture_;
29  float depth_;
30  Vertex top_left_;
31  Vertex top_right_;
32  Vertex bottom_right_;
33  Vertex bottom_left_;
34 
35  // member functions
36 public:
37  Glyph(GLuint texture, float depth, const Vertex& top_left,
38  const Vertex& top_right, const Vertex& bottom_right,
39  const Vertex& bottom_left);
40 
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_; }
47 };
48 
49 class RenderBatch {
50  friend SpriteBatch;
51  // member variables
52 private:
53  GLsizei num_vertices_;
54  GLint offset_;
55  GLuint texture_;
56 
57  // member functions
58 public:
59  RenderBatch(GLint offset, GLsizei num_vertices, GLuint texture);
60 
64  GLint offset() const { return offset_; }
65  GLsizei num_vertices() const { return num_vertices_; }
66  GLuint texture() const { return texture_; }
68 };
69 
70 class SpriteBatch {
71  // member variables
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  // member functions
83 public:
84  SpriteBatch();
85  SpriteBatch(const SpriteBatch&) = delete;
86  SpriteBatch(SpriteBatch&&) = delete;
87  ~SpriteBatch();
88 
89  SpriteBatch& operator=(const SpriteBatch&) = delete;
90  SpriteBatch& operator=(SpriteBatch&&) = delete;
91 
92  // initialize vaos and vbos
93  void init();
94  void begin();
95  void end();
96  // adds a sprite to the sprite batch to be rendered later
97  void draw(const glm::vec4& destination_rect, const glm::vec4& uv_rect,
98  GLuint texture, const Color& color, float depth);
99  // render the batch
100  void render();
101 
102 private:
103  void createVertexArray();
104  void createRenderBatches();
105  void sortGlyphs();
106 };
107 
108 } // yage
109 
110 #endif
Glyph with information of the texture.
Definition: spritebatch.hpp:25
Definition: camera2d.hpp:17
diff --git a/texture_8hpp_source.html b/texture_8hpp_source.html index c4da14f8..4921ba13 100644 --- a/texture_8hpp_source.html +++ b/texture_8hpp_source.html @@ -72,7 +72,7 @@ $(function() {
diff --git a/texturecache_8hpp_source.html b/texturecache_8hpp_source.html index f2247f37..e28833a8 100644 --- a/texturecache_8hpp_source.html +++ b/texturecache_8hpp_source.html @@ -72,7 +72,7 @@ $(function() { diff --git a/vertex_8hpp_source.html b/vertex_8hpp_source.html index e52debb7..6a3289f9 100644 --- a/vertex_8hpp_source.html +++ b/vertex_8hpp_source.html @@ -72,7 +72,7 @@ $(function() { diff --git a/window_8hpp_source.html b/window_8hpp_source.html index 2be17c43..0a76ffce 100644 --- a/window_8hpp_source.html +++ b/window_8hpp_source.html @@ -72,7 +72,7 @@ $(function() { diff --git a/yage_8hpp_source.html b/yage_8hpp_source.html index c692cf35..ac333ea1 100644 --- a/yage_8hpp_source.html +++ b/yage_8hpp_source.html @@ -72,7 +72,7 @@ $(function() { -- cgit