diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-11-06 20:48:33 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-11-07 01:02:02 +0000 |
commit | 2f8d7643d03f39fa848576692264d0fe3a37ed91 (patch) | |
tree | f4578e2ce3020c04a206f9eb0bc02587de5b3d6a /gfx/gl/shadowMapper.cpp | |
parent | Don't request a specific OpenGL version, just check we get something sufficie... (diff) | |
download | ilt-2f8d7643d03f39fa848576692264d0fe3a37ed91.tar.bz2 ilt-2f8d7643d03f39fa848576692264d0fe3a37ed91.tar.xz ilt-2f8d7643d03f39fa848576692264d0fe3a37ed91.zip |
Reformat with new clang-format
Diffstat (limited to 'gfx/gl/shadowMapper.cpp')
-rw-r--r-- | gfx/gl/shadowMapper.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gfx/gl/shadowMapper.cpp b/gfx/gl/shadowMapper.cpp index 55d986c..79b39c0 100644 --- a/gfx/gl/shadowMapper.cpp +++ b/gfx/gl/shadowMapper.cpp @@ -94,11 +94,13 @@ struct DefinitionsInserter { { return out.maps++; }; + auto operator*() { return std::tie(out.projections[out.maps], out.regions[out.maps]); } + ShadowMapper::Definitions & out; }; @@ -161,12 +163,14 @@ ShadowMapper::update(const SceneProvider & scene, const glm::vec3 & dir, const C } ShadowMapper::FixedPoint::FixedPoint(const Shader & vs) : Program {vs}, viewProjectionLoc {*this, "viewProjection"} { } + void ShadowMapper::FixedPoint::setViewProjection(const glm::mat4 & viewProjection) const { use(); glUniformMatrix4fv(viewProjectionLoc, 1, GL_FALSE, glm::value_ptr(viewProjection)); } + void ShadowMapper::FixedPoint::use() const { @@ -177,12 +181,14 @@ ShadowMapper::DynamicPoint::DynamicPoint() : Program {shadowDynamicPoint_vs}, viewProjectionLoc {*this, "viewProjection"}, modelLoc {*this, "model"} { } + void ShadowMapper::DynamicPoint::setViewProjection(const glm::mat4 & viewProjection) const { glUseProgram(*this); glUniformMatrix4fv(viewProjectionLoc, 1, GL_FALSE, glm::value_ptr(viewProjection)); } + void ShadowMapper::DynamicPoint::use(const Location & location) const { @@ -191,6 +197,7 @@ ShadowMapper::DynamicPoint::use(const Location & location) const const auto model = glm::translate(location.pos) * rotate_ypr(location.rot); glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(model)); } + void ShadowMapper::DynamicPoint::setModel(const Location & location) const { |