From 07064efcfecb0f1140f829ee2481079fa02cc587 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 7 Jul 2024 23:21:25 +0100 Subject: Simplify setup of uniform locations and containing programs --- gfx/gl/shadowMapper.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'gfx/gl/shadowMapper.cpp') diff --git a/gfx/gl/shadowMapper.cpp b/gfx/gl/shadowMapper.cpp index c537314..a846a3d 100644 --- a/gfx/gl/shadowMapper.cpp +++ b/gfx/gl/shadowMapper.cpp @@ -108,15 +108,10 @@ ShadowMapper::update(const SceneProvider & scene, const Direction3D & dir, const return out; } -ShadowMapper::ShadowProgram::ShadowProgram(const Shader & vs) : - Program {vs, commonShadowPoint_gs}, viewProjectionLoc {*this, "viewProjection"}, - viewProjectionsLoc {*this, "viewProjections"}, viewPointLoc {*this, "viewPoint"} -{ -} +ShadowMapper::ShadowProgram::ShadowProgram(const Shader & vs) : Program {vs, commonShadowPoint_gs} { } ShadowMapper::ShadowProgram::ShadowProgram(const Shader & vs, const Shader & gs, const Shader & fs) : - Program {vs, gs, fs}, viewProjectionLoc {*this, "viewProjection"}, viewProjectionsLoc {*this, "viewProjections"}, - viewPointLoc {*this, "viewPoint"} + Program {vs, gs, fs} { } @@ -136,12 +131,7 @@ ShadowMapper::ShadowProgram::use() const glUseProgram(*this); } -ShadowMapper::FixedPoint::FixedPoint(const Shader & vs) : ShadowProgram {vs} { } - -ShadowMapper::DynamicPoint::DynamicPoint() : - ShadowProgram {shadowDynamicPoint_vs}, modelLoc {*this, "model"}, modelPosLoc {*this, "modelPos"} -{ -} +ShadowMapper::DynamicPoint::DynamicPoint() : ShadowProgram {shadowDynamicPoint_vs} { } void ShadowMapper::DynamicPoint::use(const Location & location) const -- cgit v1.2.3