summaryrefslogtreecommitdiff
path: root/gfx/gl/sceneShader.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-14 11:38:09 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-14 11:38:09 +0000
commit08128c14ec49a2b357e830c832ccd0a8e63c175d (patch)
tree6634dea4e5d8bac32bdcf1c2ea68000874c61a5a /gfx/gl/sceneShader.cpp
parentWe only need 3x3 matrix for model rotation spec (diff)
downloadilt-08128c14ec49a2b357e830c832ccd0a8e63c175d.tar.bz2
ilt-08128c14ec49a2b357e830c832ccd0a8e63c175d.tar.xz
ilt-08128c14ec49a2b357e830c832ccd0a8e63c175d.zip
Add traits wrapper for setting uniforms
Diffstat (limited to 'gfx/gl/sceneShader.cpp')
-rw-r--r--gfx/gl/sceneShader.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/gfx/gl/sceneShader.cpp b/gfx/gl/sceneShader.cpp
index dc77793..1b3b27c 100644
--- a/gfx/gl/sceneShader.cpp
+++ b/gfx/gl/sceneShader.cpp
@@ -47,8 +47,8 @@ void
SceneShader::SceneProgram::setViewProjection(const GlobalPosition3D & viewPoint, const glm::mat4 & viewProjection) const
{
glUseProgram(*this);
- glUniformMatrix4fv(viewProjectionLoc, 1, GL_FALSE, glm::value_ptr(viewProjection));
- glUniform3iv(viewPointLoc, 1, glm::value_ptr(viewPoint));
+ glUniform(viewProjectionLoc, viewProjection);
+ glUniform(viewPointLoc, viewPoint);
}
void
@@ -56,7 +56,7 @@ SceneShader::SceneProgram::setViewPort(const ViewPort & viewPort) const
{
if (viewPortLoc >= 0) {
glUseProgram(*this);
- glUniform4iv(viewPortLoc, 1, glm::value_ptr(viewPort));
+ glUniform(viewPortLoc, viewPort);
}
}
@@ -68,8 +68,8 @@ SceneShader::BasicProgram::BasicProgram() :
void
SceneShader::BasicProgram::setModel(Location const & location) const
{
- glUniformMatrix3fv(modelLoc, 1, GL_FALSE, glm::value_ptr(location.getRotationTransform()));
- glUniform3iv(modelPosLoc, 1, glm::value_ptr(location.pos));
+ glUniform(modelLoc, location.getRotationTransform());
+ glUniform(modelPosLoc, location.pos);
}
void
@@ -85,5 +85,5 @@ void
SceneShader::WaterProgram::use(float waveCycle) const
{
Program::use();
- glUniform1f(waveLoc, waveCycle);
+ glUniform(waveLoc, waveCycle);
}