Error handling, Keyboard input, Shader stuff

This commit is contained in:
4VRDriver
2020-09-01 22:36:50 +02:00
parent 4efc99b630
commit 77dd6efcce
15 changed files with 303 additions and 21 deletions

View File

@@ -82,3 +82,18 @@ GLuint ShaderProgram::compile(std::string shaderSource, GLenum type) {
}
return shaderId;
}
void ShaderProgram::setBool(const char *name, bool value) const {
GLint location = glGetUniformLocation(shaderProgramId, name);
glUniform1i(location, (int)value);
}
void ShaderProgram::setInt(const char *name, int value) const {
GLint location = glGetUniformLocation(shaderProgramId, name);
glUniform1i(location, value);
}
void ShaderProgram::setFloat(const char *name, float value) const {
GLint location = glGetUniformLocation(shaderProgramId, name);
glUniform1f(location, value);
}