-
Notifications
You must be signed in to change notification settings - Fork 0
/
TextVertex.cpp
40 lines (31 loc) · 1012 Bytes
/
TextVertex.cpp
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
#include "TextVertex.hpp"
#include "akj_ogl.h"
cTextVertex::~cTextVertex(void)
{
}
void cTextVertex::BindAttributes()
{
const int byte_stride = ByteStride();
//texCoord
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, byte_stride, AKJ_FLOAT_OFFSET(0) );
//normal
glEnableVertexAttribArray(1);
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, byte_stride, AKJ_FLOAT_OFFSET(2) );
//velocity
glEnableVertexAttribArray(2);
glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, byte_stride, AKJ_FLOAT_OFFSET(4) );
//acceleration
glEnableVertexAttribArray(3);
glVertexAttribPointer(3, 2, GL_FLOAT, GL_FALSE, byte_stride, AKJ_FLOAT_OFFSET(6) );
// start time
glEnableVertexAttribArray(4);
glVertexAttribPointer(4, 1, GL_FLOAT, GL_FALSE, byte_stride, AKJ_FLOAT_OFFSET(8) );
// other stuff
glEnableVertexAttribArray(5);
glVertexAttribPointer(5, 3, GL_FLOAT, GL_FALSE, byte_stride, AKJ_FLOAT_OFFSET(9) );
}
int cTextVertex::ByteStride()
{
return 12*sizeof(GLfloat);
}