diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-03-08 16:02:56 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-03-08 16:02:56 +0000 |
| commit | 00fc3cb9b2c06026fab0e4760609fe02e027b6df (patch) | |
| tree | b84b527824ac1d5c999fc4a974fcf2c356b422ab /ui/svgIcon.cpp | |
| parent | Replace gl_traits glTexParameter with glTexture::parameter DSA wrapper (diff) | |
| download | ilt-00fc3cb9b2c06026fab0e4760609fe02e027b6df.tar.bz2 ilt-00fc3cb9b2c06026fab0e4760609fe02e027b6df.tar.xz ilt-00fc3cb9b2c06026fab0e4760609fe02e027b6df.zip | |
Move all low level texture operations to DSA helpers in glTexture
Diffstat (limited to 'ui/svgIcon.cpp')
| -rw-r--r-- | ui/svgIcon.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
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<GL_TEXTURE_2D>) <= sizeof(ImTextureID)); // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast,performance-no-int-to-ptr) This is how ImGui works return reinterpret_cast<ImTextureID>(*texture); } |
