Opaque identifier for a UI texture registration, in the form ImGui carries through draw data. More...
#include "donner/editor/gui/UiTextureRegistry.h"
Public Member Functions | |
| UiTextureId ()=default | |
| Constructs a null identifier. | |
| bool | isValid () const |
| Returns true if this identifier is non-null. A non-null identifier may still be stale; only UiTextureRegistry::lookup is authoritative. | |
| uint32_t | slotIndex () const |
| Registry slot index this identifier names. | |
| uint32_t | generation () const |
| Registry slot generation at registration time. Zero for null identifiers. | |
| ImTextureID | imTextureId () const |
Returns the value to hand ImGui, which returns it unchanged in ImDrawCmd. Zero for null identifiers. | |
| bool | operator== (const UiTextureId &other) const =default |
| Equality operator. | |
Static Public Member Functions | |
| static UiTextureId | FromImTextureId (ImTextureID value) |
| Reconstructs an identifier from a value ImGui carried through draw data. | |
| static UiTextureId | CreateForRegistry (uint32_t slotIndex, uint32_t generation) |
| Mints an identifier for a registry slot; called by UiTextureRegistry only. | |
Opaque identifier for a UI texture registration, in the form ImGui carries through draw data.
The value is a registry slot plus the generation that slot held when the registration was made. It is deliberately not a backend object address: a value reaching the registry from recorded draw data is untrusted, and a slot/generation pair lets a recycled slot reject a token minted for the registration that used to live there. Slot generations start at one, so every valid identifier is nonzero and zero keeps ImGui's "no texture" meaning.
|
inlinestatic |
Mints an identifier for a registry slot; called by UiTextureRegistry only.
| slotIndex | Registry slot index. |
| generation | Slot generation at registration time; must be nonzero. |
|
inlinestatic |
Reconstructs an identifier from a value ImGui carried through draw data.
The value is not trusted: the resulting identifier is only meaningful once UiTextureRegistry::lookup accepts it.
| value | Value previously returned by imTextureId. |
|
default |
Equality operator.
| other | Identifier to compare against. |