From d7364eb89f81fa770bc3658a93917412baa020df Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Thu, 24 Aug 2017 00:24:58 +0100 Subject: Updating docs --- vertex_8hpp_source.html | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'vertex_8hpp_source.html') diff --git a/vertex_8hpp_source.html b/vertex_8hpp_source.html index 18d53ea7..eb7a600b 100644 --- a/vertex_8hpp_source.html +++ b/vertex_8hpp_source.html @@ -85,37 +85,37 @@ $(document).ready(function(){initNavTree('vertex_8hpp_source.html','');});
vertex.hpp
-Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * vertex.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 VERTEX_HPP
10 #define VERTEX_HPP
11 
12 #include <GL/glew.h>
13 
14 namespace yage {
15 
16 struct Position {
17  float x;
18  float y;
19 
20  Position() = default;
21 
22  Position(float x_, float y_) : x(x_), y(y_) {}
23 };
24 
25 struct Color {
26  GLubyte r;
27  GLubyte g;
28  GLubyte b;
29  GLubyte a;
30 
31  Color() = default;
32 
33  Color(GLubyte r_, GLubyte g_, GLubyte b_, GLubyte a_)
34  : r(r_), g(g_), b(b_), a(a_) {}
35 };
36 
37 struct UV {
38  float u;
39  float v;
40 
41  UV() = default;
42 
43  UV(float u_, float v_) : u(u_), v(v_) {}
44 };
45 
46 struct Vertex {
49  UV uv;
50 
51  Vertex() = default;
52 
53  Vertex(const Position& position_, const Color& color_, const UV& uv_)
54  : position(position_), color(color_), uv(uv_) {}
55 
56  void setPosition(float x, float y) {
57  position.x = x;
58  position.y = y;
59  }
60 
61  void setColor(GLubyte r, GLubyte g, GLubyte b, GLubyte a) {
62  color.r = r;
63  color.g = g;
64  color.b = b;
65  color.a = a;
66  }
67 
68  void setUv(float u, float v) {
69  uv.u = u;
70  uv.v = v;
71  }
72 };
73 
74 } // yage
75 
76 #endif
Position()=default
-
Definition: vertex.hpp:46
-
Position position
Definition: vertex.hpp:47
-
UV(float u_, float v_)
Definition: vertex.hpp:43
-
float v
Definition: vertex.hpp:39
-
void setColor(GLubyte r, GLubyte g, GLubyte b, GLubyte a)
Definition: vertex.hpp:61
-
float x
Definition: vertex.hpp:17
-
GLubyte g
Definition: vertex.hpp:27
-
float y
Definition: vertex.hpp:18
-
Color color
Definition: vertex.hpp:48
-
void setUv(float u, float v)
Definition: vertex.hpp:68
-
Color(GLubyte r_, GLubyte g_, GLubyte b_, GLubyte a_)
Definition: vertex.hpp:33
-
Position(float x_, float y_)
Definition: vertex.hpp:22
-
GLubyte r
Definition: vertex.hpp:26
-
Definition: vertex.hpp:37
-
void setPosition(float x, float y)
Definition: vertex.hpp:56
-
GLubyte b
Definition: vertex.hpp:28
-
Definition: vertex.hpp:16
+Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * vertex.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 VERTEX_HPP
10 #define VERTEX_HPP
11 
12 #include <GL/glew.h>
13 
14 namespace yage
15 {
16 
17 struct Position {
18  float x;
19  float y;
20 
21  Position() = default;
22 
23  Position(float x_, float y_) : x(x_), y(y_) {}
24 };
25 
26 struct Color {
27  GLubyte r;
28  GLubyte g;
29  GLubyte b;
30  GLubyte a;
31 
32  Color() = default;
33 
34  Color(GLubyte r_, GLubyte g_, GLubyte b_, GLubyte a_)
35  : r(r_), g(g_), b(b_), a(a_)
36  {
37  }
38 };
39 
40 struct UV {
41  float u;
42  float v;
43 
44  UV() = default;
45 
46  UV(float u_, float v_) : u(u_), v(v_) {}
47 };
48 
49 struct Vertex {
52  UV uv;
53 
54  Vertex() = default;
55 
56  Vertex(const Position &position_, const Color &color_, const UV &uv_)
57  : position(position_), color(color_), uv(uv_)
58  {
59  }
60 
61  void setPosition(float x, float y)
62  {
63  position.x = x;
64  position.y = y;
65  }
66 
67  void setColor(GLubyte r, GLubyte g, GLubyte b, GLubyte a)
68  {
69  color.r = r;
70  color.g = g;
71  color.b = b;
72  color.a = a;
73  }
74 
75  void setUv(float u, float v)
76  {
77  uv.u = u;
78  uv.v = v;
79  }
80 };
81 
82 } // yage
83 
84 #endif
Position()=default
+
Definition: vertex.hpp:49
+
Position position
Definition: vertex.hpp:50
+
UV(float u_, float v_)
Definition: vertex.hpp:46
+
float v
Definition: vertex.hpp:42
+
void setColor(GLubyte r, GLubyte g, GLubyte b, GLubyte a)
Definition: vertex.hpp:67
+
float x
Definition: vertex.hpp:18
+
GLubyte g
Definition: vertex.hpp:28
+
float y
Definition: vertex.hpp:19
+
Color color
Definition: vertex.hpp:51
+
void setUv(float u, float v)
Definition: vertex.hpp:75
+
Color(GLubyte r_, GLubyte g_, GLubyte b_, GLubyte a_)
Definition: vertex.hpp:34
+
Position(float x_, float y_)
Definition: vertex.hpp:23
+
GLubyte r
Definition: vertex.hpp:27
+
Definition: vertex.hpp:40
+
void setPosition(float x, float y)
Definition: vertex.hpp:61
+
GLubyte b
Definition: vertex.hpp:29
+
Definition: vertex.hpp:17
Templated matrix class.
Definition: camera2d.hpp:17
-
UV uv
Definition: vertex.hpp:49
-
Vertex(const Position &position_, const Color &color_, const UV &uv_)
Definition: vertex.hpp:53
-
float u
Definition: vertex.hpp:38
-
GLubyte a
Definition: vertex.hpp:29
-
Definition: vertex.hpp:25
+
UV uv
Definition: vertex.hpp:52
+
Vertex(const Position &position_, const Color &color_, const UV &uv_)
Definition: vertex.hpp:56
+
float u
Definition: vertex.hpp:41
+
GLubyte a
Definition: vertex.hpp:30
+
Definition: vertex.hpp:26