-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTransformShader.cpp
More file actions
47 lines (39 loc) · 959 Bytes
/
TransformShader.cpp
File metadata and controls
47 lines (39 loc) · 959 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
43
44
45
46
47
#include "TransformShader.h"
TransformShader::TransformShader()
{
}
TransformShader::~TransformShader()
{
}
void TransformShader::bindAttributes()
{
bindAttribute(0, "vertexPosition");
}
void TransformShader::getUniformLocations()
{
_axisIdLoc = getUniformLocation("axisID");
_selectedLoc = getUniformLocation("selected");
_modelMatrixLoc = getUniformLocation("model");
_viewMatrixLoc = getUniformLocation("view");
_projectionMatrixLoc = getUniformLocation("projection");
}
void TransformShader::loadSelected(bool selected)
{
loadBool(_selectedLoc, selected);
}
void TransformShader::loadAxisID(int id)
{
loadInt(_axisIdLoc, id);
}
void TransformShader::loadModelMatrix(glm::mat4 matrix)
{
loadMatrix4f(_modelMatrixLoc, matrix);
}
void TransformShader::loadViewMatrix(glm::mat4 matrix)
{
loadMatrix4f(_viewMatrixLoc, matrix);
}
void TransformShader::loadProjectionMatrix(glm::mat4 matrix)
{
loadMatrix4f(_projectionMatrixLoc, matrix);
}