Add a basic entity class

This commit is contained in:
4VRDriver
2020-09-06 13:02:40 +02:00
parent c0cbf8c257
commit e4139105ee
20 changed files with 150 additions and 77 deletions

View File

@@ -106,6 +106,11 @@ void ShaderProgram::setUniform(const char *name, float value) const {
glUniform1f(location, value);
}
void ShaderProgram::setUniform(const char *name, glm::vec3 vector) const {
GLint location = glGetUniformLocation(shaderProgramId, name);
glUniform3f(location, vector.x, vector.y, vector.z);
}
void ShaderProgram::setUniform(const char *name, glm::mat4 matrix) const {
GLint location = glGetUniformLocation(shaderProgramId, name);
glUniformMatrix4fv(location, 1, GL_FALSE, glm::value_ptr(matrix));