diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-04-02 23:22:12 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-04-02 23:22:12 +0100 |
commit | 2245fc8a3bb521afc2e6dd575cd1757ecab23558 (patch) | |
tree | c4565e14b2e9b01c970b3ee5816f6ec849b61e92 /ui/icon.cpp | |
parent | Merge remote-tracking branch 'origin/ptrs' (diff) | |
parent | Remove the old unused network.png icon (diff) | |
download | ilt-2245fc8a3bb521afc2e6dd575cd1757ecab23558.tar.bz2 ilt-2245fc8a3bb521afc2e6dd575cd1757ecab23558.tar.xz ilt-2245fc8a3bb521afc2e6dd575cd1757ecab23558.zip |
Diffstat (limited to 'ui/icon.cpp')
-rw-r--r-- | ui/icon.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ui/icon.cpp b/ui/icon.cpp index c3b5078..0bdc91a 100644 --- a/ui/icon.cpp +++ b/ui/icon.cpp @@ -22,9 +22,10 @@ Icon::Icon(const Image & tex) : size {tex.width, tex.height} GL_RGBA, GL_UNSIGNED_BYTE, tex.data.data()); } -void -Icon::Bind() const +ImTextureID +Icon::operator*() const { - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, m_texture); + static_assert(sizeof(m_texture) <= sizeof(ImTextureID)); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast,performance-no-int-to-ptr) This is how ImGui works + return reinterpret_cast<ImTextureID>(*m_texture); } |