summaryrefslogtreecommitdiff
path: root/gfx/gl/billboardPainter.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan.goodliffe@octal.co.uk>2026-03-02 13:17:28 +0000
committerDan Goodliffe <dan.goodliffe@octal.co.uk>2026-03-02 13:17:28 +0000
commit64ede41ebaade64ad6705f7f55ca4a778a156481 (patch)
tree6d2fbc64cd28d272fe3f5bbf79ddd41ecc5e2626 /gfx/gl/billboardPainter.cpp
parentRefactor glArrays to better expose underlying types (diff)
downloadilt-64ede41ebaade64ad6705f7f55ca4a778a156481.tar.bz2
ilt-64ede41ebaade64ad6705f7f55ca4a778a156481.tar.xz
ilt-64ede41ebaade64ad6705f7f55ca4a778a156481.zip
Wrap up some low level texture operations in glTexture classHEADmain
Fixes previously hard coded billboard texture size.
Diffstat (limited to 'gfx/gl/billboardPainter.cpp')
-rw-r--r--gfx/gl/billboardPainter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/gfx/gl/billboardPainter.cpp b/gfx/gl/billboardPainter.cpp
index e72e72d..06e13ca 100644
--- a/gfx/gl/billboardPainter.cpp
+++ b/gfx/gl/billboardPainter.cpp
@@ -40,8 +40,8 @@ BillboardPainter::createBillBoardTextures(GLsizei width, GLsizei height)
glTextures<3> textures;
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- const auto configuregdata = [width, height](const GLuint texture, const GLint iformat, const GLenum format) {
- glBindTexture(GL_TEXTURE_2D_ARRAY, texture);
+ const auto configuregdata = [width, height](const auto & texture, const GLint iformat, const GLenum format) {
+ texture.bind(GL_TEXTURE_2D_ARRAY);
glTexParameter(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameter(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameter(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
@@ -78,7 +78,7 @@ BillboardPainter::renderBillBoard(
}
glUseProgram(program);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- const TextureDimensions billboardSize = {256, 256, 8}; // Texture::getSize(billboard[0]);
+ const TextureDimensions billboardSize = billboard[0].getSize();
glViewport(0, 0, billboardSize.x, billboardSize.y);
const auto & centre = mesh.getDimensions().centre;
const auto & size = mesh.getDimensions().size;