summaryrefslogtreecommitdiff
path: root/ui/icon.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2025-04-02 23:22:12 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2025-04-02 23:22:12 +0100
commit2245fc8a3bb521afc2e6dd575cd1757ecab23558 (patch)
treec4565e14b2e9b01c970b3ee5816f6ec849b61e92 /ui/icon.cpp
parentMerge remote-tracking branch 'origin/ptrs' (diff)
parentRemove the old unused network.png icon (diff)
downloadilt-2245fc8a3bb521afc2e6dd575cd1757ecab23558.tar.bz2
ilt-2245fc8a3bb521afc2e6dd575cd1757ecab23558.tar.xz
ilt-2245fc8a3bb521afc2e6dd575cd1757ecab23558.zip
Merge branch 'imgui'HEADmain
Diffstat (limited to 'ui/icon.cpp')
-rw-r--r--ui/icon.cpp9
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);
}