From a18ea136a540d271687fd88831bc14394107dba5 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 29 Jan 2024 00:18:02 +0000 Subject: Merge common parts of shadow programs into a base class --- gfx/gl/shadowMapper.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'gfx/gl/shadowMapper.h') diff --git a/gfx/gl/shadowMapper.h b/gfx/gl/shadowMapper.h index 421e6a5..4f81e58 100644 --- a/gfx/gl/shadowMapper.h +++ b/gfx/gl/shadowMapper.h @@ -24,9 +24,10 @@ public: [[nodiscard]] Definitions update(const SceneProvider &, const Direction3D & direction, const Camera &) const; - class FixedPoint : public Program { + class ShadowProgram : public Program { public: - FixedPoint(const Shader & vs, const Shader & gs); + explicit ShadowProgram(const Shader & vs); + void setViewPoint(const GlobalPosition3D, size_t n) const; void setViewProjection(const glm::mat4 &, size_t n) const; void use() const; @@ -37,18 +38,18 @@ public: RequiredUniformLocation viewPointLoc; }; - class DynamicPoint : public Program { + class FixedPoint : public ShadowProgram { + public: + explicit FixedPoint(const Shader & vs); + }; + + class DynamicPoint : public ShadowProgram { public: DynamicPoint(); - void setViewPoint(const GlobalPosition3D, size_t n) const; - void setViewProjection(const glm::mat4 &, size_t n) const; void use(const Location &) const; void setModel(const Location &) const; private: - std::array viewProjectionLoc; - RequiredUniformLocation viewProjectionsLoc; - RequiredUniformLocation viewPointLoc; RequiredUniformLocation modelLoc; RequiredUniformLocation modelPosLoc; }; -- cgit v1.2.3