aboutsummaryrefslogtreecommitdiffstats
path: root/include/YAGE/vertex.hpp
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-04-02 09:19:32 +0100
committerYann Herklotz <ymherklotz@gmail.com>2017-04-02 09:19:32 +0100
commitaa67c8bb56cb750ac83ecbd361439f5ecb5e12d9 (patch)
treef1517a86654cf5457fa0b3aa6cfaea4bfa4eef36 /include/YAGE/vertex.hpp
parent21a147c3c1c2fad2819fe76becab320c51eb131f (diff)
downloadYAGE-aa67c8bb56cb750ac83ecbd361439f5ecb5e12d9.tar.gz
YAGE-aa67c8bb56cb750ac83ecbd361439f5ecb5e12d9.zip
Renamed includes
Diffstat (limited to 'include/YAGE/vertex.hpp')
-rw-r--r--include/YAGE/vertex.hpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/include/YAGE/vertex.hpp b/include/YAGE/vertex.hpp
new file mode 100644
index 00000000..d9ab1138
--- /dev/null
+++ b/include/YAGE/vertex.hpp
@@ -0,0 +1,53 @@
+#ifndef VERTEX_HPP
+#define VERTEX_HPP
+
+#include <GL/glew.h>
+
+struct Position
+{
+ float x;
+ float y;
+};
+
+struct Color
+{
+ GLubyte r;
+ GLubyte g;
+ GLubyte b;
+ GLubyte a;
+};
+
+struct UV
+{
+ float u;
+ float v;
+};
+
+struct Vertex
+{
+ Position position;
+ Color color;
+ UV uv;
+
+ void setPosition(float x, float y)
+ {
+ position.x = x;
+ position.y = y;
+ }
+
+ void setColor(GLubyte r, GLubyte g, GLubyte b, GLubyte a)
+ {
+ color.r = r;
+ color.g = g;
+ color.b = b;
+ color.a = a;
+ }
+
+ void setUv(float u, float v)
+ {
+ uv.u = u;
+ uv.v = v;
+ }
+};
+
+#endif