summaryrefslogtreecommitdiff
path: root/ui/font.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 /ui/font.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 'ui/font.cpp')
-rw-r--r--ui/font.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/font.cpp b/ui/font.cpp
index ebd29d0..d8e1257 100644
--- a/ui/font.cpp
+++ b/ui/font.cpp
@@ -116,12 +116,12 @@ Font::getTextureWithSpace(unsigned int adv) const
return (ft.used + adv) < size.x;
});
itr != fontTextures.end()) {
- glBindTexture(GL_TEXTURE_2D, itr->texture);
+ itr->texture.bind();
return static_cast<std::size_t>(itr - fontTextures.begin());
}
auto & texture = fontTextures.emplace_back();
- glBindTexture(GL_TEXTURE_2D, texture.texture);
+ texture.texture.bind();
glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, static_cast<GLsizei>(size.x), static_cast<GLsizei>(size.y), 0, GL_RED,
GL_UNSIGNED_BYTE, nullptr);
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);