From 08128c14ec49a2b357e830c832ccd0a8e63c175d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 14 Jan 2024 11:38:09 +0000 Subject: Add traits wrapper for setting uniforms --- gfx/gl/sceneShader.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gfx/gl/sceneShader.cpp') 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); } -- cgit v1.2.3