-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextShader.cpp
More file actions
42 lines (34 loc) · 798 Bytes
/
TextShader.cpp
File metadata and controls
42 lines (34 loc) · 798 Bytes
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
#include "TextShader.h"
TextShader::TextShader()
{
}
TextShader::~TextShader()
{
}
void TextShader::bindAttributes()
{
bindAttribute(0, "vertex");
}
void TextShader::getUniformLocations()
{
_projectionMatrixLoc = getUniformLocation("projectionMatrix");
_transformMatrixLoc = getUniformLocation("transformMatrix");
_colorLoc = getUniformLocation("glyphColor");
_glyphTexLoc = getUniformLocation("text");
}
void TextShader::loadGlyph()
{
loadInt(_glyphTexLoc, 0);
}
void TextShader::loadTransformationMatrix(glm::mat4 matrix)
{
loadMatrix4f(_transformMatrixLoc, matrix);
}
void TextShader::loadProjectionMatrix(glm::mat4 matrix)
{
loadMatrix4f(_projectionMatrixLoc, matrix);
}
void TextShader::loadColor(glm::vec3 color)
{
loadVector3f(_colorLoc, color);
}