aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/opengl/shader.h
diff options
context:
space:
mode:
authorJohannes Schickel2016-01-02 14:09:41 +0100
committerJohannes Schickel2016-03-16 20:29:26 +0100
commite66e9e44d358b0cc90d128c31e695a8ace4177fa (patch)
tree0833ca6a0c8956ba7c8ec01eb0d64c19aa6ec9b4 /backends/graphics/opengl/shader.h
parentde3846923c9a00ff6a8563e33858e12a72bfebda (diff)
downloadscummvm-rg350-e66e9e44d358b0cc90d128c31e695a8ace4177fa.tar.gz
scummvm-rg350-e66e9e44d358b0cc90d128c31e695a8ace4177fa.tar.bz2
scummvm-rg350-e66e9e44d358b0cc90d128c31e695a8ace4177fa.zip
OPENGL: Accelerate palette lookups with shaders.
This currently is limited to GL contexts.
Diffstat (limited to 'backends/graphics/opengl/shader.h')
-rw-r--r--backends/graphics/opengl/shader.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/backends/graphics/opengl/shader.h b/backends/graphics/opengl/shader.h
index f9dcbb0c61..458ecb9f16 100644
--- a/backends/graphics/opengl/shader.h
+++ b/backends/graphics/opengl/shader.h
@@ -71,6 +71,24 @@ public:
* @param projectionMatrix Projection matrix to use.
*/
void activate(const GLfloat *projectionMatrix);
+
+ /**
+ * Return location for uniform with given name.
+ *
+ * @param name Name of the uniform to look up in the shader.
+ * @return The location or -1 if uniform was not found.
+ */
+ GLint getUniformLocation(const char *name) const;
+
+ /**
+ * Bind value to uniform.
+ *
+ * Note: this only works when the shader is actived by activate.
+ *
+ * @param location Location of the uniform.
+ * @param value The value to be set.
+ */
+ void setUniformI(GLint location, GLint value);
protected:
/**
* Vertex shader sources.