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/icon.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/icon.cpp')
| -rw-r--r-- | ui/icon.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ui/icon.cpp b/ui/icon.cpp index 5ab9c64..e0399e5 100644 --- a/ui/icon.cpp +++ b/ui/icon.cpp @@ -10,14 +10,12 @@ Icon::Icon(const std::filesystem::path & fileName) : Icon {Image {Resource::mapP Icon::Icon(const Image & tex) : size {tex.width, tex.height} { - m_texture.bind(); - + m_texture.storage(1, GL_RGBA8, size); m_texture.parameter(GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); m_texture.parameter(GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); m_texture.parameter(GL_TEXTURE_MIN_FILTER, GL_LINEAR); m_texture.parameter(GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, static_cast<GLsizei>(tex.width), static_cast<GLsizei>(tex.height), 0, - GL_RGBA, GL_UNSIGNED_BYTE, tex.data.data()); + m_texture.image(size, GL_RGBA, GL_UNSIGNED_BYTE, tex.data.data()); } ImTextureID |
