aboutsummaryrefslogtreecommitdiffstats
path: root/include/YAGE/vertex.hpp
blob: 5826aeeedc2666b56c2f8bd27a30336a172fdf3a (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
54
55
56
57
58
#ifndef VERTEX_HPP
#define VERTEX_HPP

#include <GL/glew.h>

namespace yage
{

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;
    }
};
    
} // yage

#endif