From 21a147c3c1c2fad2819fe76becab320c51eb131f Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sun, 2 Apr 2017 09:15:30 +0100 Subject: Adding initial files --- include/yage/vertex.hpp | 53 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 include/yage/vertex.hpp (limited to 'include/yage/vertex.hpp') 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 + +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 -- cgit