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.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'gfx/gl/shadowMapper.h') diff --git a/gfx/gl/shadowMapper.h b/gfx/gl/shadowMapper.h index 967d93b..73dadd0 100644 --- a/gfx/gl/shadowMapper.h +++ b/gfx/gl/shadowMapper.h @@ -30,14 +30,9 @@ public: void use() const; private: - RequiredUniformLocation viewProjectionLoc; - RequiredUniformLocation viewProjectionsLoc; - RequiredUniformLocation viewPointLoc; - }; - - class FixedPoint : public ShadowProgram { - public: - explicit FixedPoint(const Shader & vs); + RequiredUniformLocation viewProjectionLoc {*this, "viewProjection"}; + RequiredUniformLocation viewProjectionsLoc {*this, "viewProjections"}; + RequiredUniformLocation viewPointLoc {*this, "viewPoint"}; }; class DynamicPoint : public ShadowProgram { @@ -47,12 +42,11 @@ public: void setModel(const Location &) const; private: - RequiredUniformLocation modelLoc; - RequiredUniformLocation modelPosLoc; + RequiredUniformLocation modelLoc {*this, "model"}; + RequiredUniformLocation modelPosLoc {*this, "modelPos"}; }; - FixedPoint landmess, dynamicPointInst; - ShadowProgram dynamicPointInstWithTextures; + ShadowProgram landmess, dynamicPointInst, dynamicPointInstWithTextures; DynamicPoint dynamicPoint; // NOLINTNEXTLINE(hicpp-explicit-conversions) -- cgit v1.2.3