summaryrefslogtreecommitdiff
path: root/gfx/gl/shadowMapper.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/shadowMapper.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/shadowMapper.cpp')
-rw-r--r--gfx/gl/shadowMapper.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/gfx/gl/shadowMapper.cpp b/gfx/gl/shadowMapper.cpp
index 5dc555a..ae374fe 100644
--- a/gfx/gl/shadowMapper.cpp
+++ b/gfx/gl/shadowMapper.cpp
@@ -4,6 +4,7 @@
#include "gfx/gl/shaders/vs-shadowDynamicPoint.h"
#include "gfx/gl/shaders/vs-shadowDynamicPointInst.h"
#include "gfx/gl/shaders/vs-shadowFixedPoint.h"
+#include "gl_traits.h"
#include "location.h"
#include "maths.h"
#include "sceneProvider.h"
@@ -174,8 +175,8 @@ void
ShadowMapper::FixedPoint::setViewProjection(const GlobalPosition3D viewPoint, const glm::mat4 & viewProjection) const
{
use();
- glUniformMatrix4fv(viewProjectionLoc, 1, GL_FALSE, glm::value_ptr(viewProjection));
- glUniform3iv(viewPointLoc, 1, glm::value_ptr(viewPoint));
+ glUniform(viewProjectionLoc, viewProjection);
+ glUniform(viewPointLoc, viewPoint);
}
void
@@ -194,8 +195,8 @@ void
ShadowMapper::DynamicPoint::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
@@ -208,6 +209,6 @@ ShadowMapper::DynamicPoint::use(const Location & location) const
void
ShadowMapper::DynamicPoint::setModel(const Location & 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);
}