From 64ede41ebaade64ad6705f7f55ca4a778a156481 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 2 Mar 2026 13:17:28 +0000 Subject: Wrap up some low level texture operations in glTexture class Fixes previously hard coded billboard texture size. --- gfx/gl/shadowStenciller.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gfx/gl/shadowStenciller.cpp') diff --git a/gfx/gl/shadowStenciller.cpp b/gfx/gl/shadowStenciller.cpp index aee7161..7a0fc9b 100644 --- a/gfx/gl/shadowStenciller.cpp +++ b/gfx/gl/shadowStenciller.cpp @@ -1,7 +1,6 @@ #include "shadowStenciller.h" #include "gfx/lightDirection.h" #include "gfx/models/mesh.h" -#include "glArrays.h" #include "gl_traits.h" #include "gldebug.h" #include "maths.h" @@ -34,7 +33,7 @@ glTexture ShadowStenciller::createStencilTexture(GLsizei width, GLsizei height) { glTexture stencil; - glBindTexture(GL_TEXTURE_2D_ARRAY, stencil); + stencil.bind(GL_TEXTURE_2D_ARRAY); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glTexParameter(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR); @@ -62,7 +61,7 @@ ShadowStenciller::renderStencil(const glTexture & stencil, const MeshBase & mesh } glUseProgram(shadowCaster); glClear(GL_DEPTH_BUFFER_BIT); - const auto stencilSize = Texture::getSize(stencil); + const auto stencilSize = stencil.getSize(); glViewport(0, 0, stencilSize.x, stencilSize.y); const auto & centre = mesh.getDimensions().centre; const auto & size = mesh.getDimensions().size; -- cgit v1.3