summaryrefslogtreecommitdiff
path: root/gfx/gl
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-10-17 18:13:27 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-10-17 18:13:27 +0100
commitf1faf9e1f5f3cca954002c9fb3c654498957f149 (patch)
tree3dd463db20f1843f59a96fe822cfaf1e35012aae /gfx/gl
parentTexture::getSize helper can be public (diff)
downloadilt-f1faf9e1f5f3cca954002c9fb3c654498957f149.tar.bz2
ilt-f1faf9e1f5f3cca954002c9fb3c654498957f149.tar.xz
ilt-f1faf9e1f5f3cca954002c9fb3c654498957f149.zip
Don't assume size of stencil texture
Diffstat (limited to 'gfx/gl')
-rw-r--r--gfx/gl/shadowStenciller.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/gfx/gl/shadowStenciller.cpp b/gfx/gl/shadowStenciller.cpp
index 30a67a7..68b12ae 100644
--- a/gfx/gl/shadowStenciller.cpp
+++ b/gfx/gl/shadowStenciller.cpp
@@ -58,7 +58,8 @@ ShadowStenciller::renderStencil(const glTexture & stencil, const MeshBase & mesh
}
glUseProgram(shadowCaster);
glClear(GL_DEPTH_BUFFER_BIT);
- glViewport(0, 0, 256, 256);
+ const auto stencilSize = Texture::getSize(stencil);
+ glViewport(0, 0, stencilSize.x, stencilSize.y);
const auto & centre = mesh.getDimensions().centre;
const auto & size = mesh.getDimensions().size;
glUniform(viewProjectionLoc,