summaryrefslogtreecommitdiff
path: root/ui/icon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ui/icon.cpp')
-rw-r--r--ui/icon.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/icon.cpp b/ui/icon.cpp
index c3b5078..847b117 100644
--- a/ui/icon.cpp
+++ b/ui/icon.cpp
@@ -28,3 +28,11 @@ Icon::Bind() const
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, m_texture);
}
+
+ImTextureID
+Icon::operator*() const
+{
+ 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);
+}