OPENGL: Accelerate palette lookups with shaders.

This currently is limited to GL contexts.
This commit is contained in:
Johannes Schickel 2016-01-02 14:09:41 +01:00
parent de3846923c
commit e66e9e44d3
9 changed files with 416 additions and 3 deletions

View file

@ -171,6 +171,16 @@ void Shader::activate(const GLfloat *projectionMatrix) {
GL_CALL(glUniform1i(_textureLocation, 0));
}
GLint Shader::getUniformLocation(const char *name) const {
GLint result = -1;
GL_ASSIGN(result, glGetUniformLocation(_program, name));
return result;
}
void Shader::setUniformI(GLint location, GLint value) {
GL_CALL(glUniform1i(location, value));
}
GLshader Shader::compileShader(const char *source, GLenum shaderType) {
GLshader handle;
GL_ASSIGN(handle, glCreateShader(shaderType));