aboutsummaryrefslogtreecommitdiffstats
path: root/include/YAGE/vertex.hpp
blob: d9ab11383f3c89f5b483e880182a14eba0503fcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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