From 00fc3cb9b2c06026fab0e4760609fe02e027b6df Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 8 Mar 2026 16:02:56 +0000 Subject: Move all low level texture operations to DSA helpers in glTexture --- ui/svgIcon.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'ui/svgIcon.cpp') diff --git a/ui/svgIcon.cpp b/ui/svgIcon.cpp index 82ef69d..2c73b5d 100644 --- a/ui/svgIcon.cpp +++ b/ui/svgIcon.cpp @@ -14,19 +14,18 @@ SvgIcon::SvgIcon(ImageDimensions dim, const std::filesystem::path & path) } bitmap.convertToRGBA(); - texture.bind(); - + texture.storage(1, GL_RGBA8, dim); texture.parameter(GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); texture.parameter(GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); texture.parameter(GL_TEXTURE_MIN_FILTER, GL_LINEAR); texture.parameter(GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, dim.x, dim.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, bitmap.data()); + texture.image(dim, GL_RGBA, GL_UNSIGNED_BYTE, bitmap.data()); } ImTextureID SvgIcon::operator*() const { - static_assert(sizeof(glTexture) <= sizeof(ImTextureID)); + static_assert(sizeof(glTexture) <= sizeof(ImTextureID)); // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast,performance-no-int-to-ptr) This is how ImGui works return reinterpret_cast(*texture); } -- cgit v1.3