ImGuiTextures
ceramic.ImGuiTextures (Class)
Cross-backend texture bridge between Dear ImGui and ceramic.
ImTextureID values are SMALL INTEGER KEYS into a registry of
ceramic.Texture instances - never raw GPU handles or pointers, so the
exact same convention works on every target (cpp, js/wasm, c#).
Also implements the Dear ImGui 1.92 dynamic texture protocol
(ImGuiBackendFlags_RendererHasTextures): each frame, ImGui may request
texture creations/updates/destructions through ImDrawData->Textures
(font atlas pages etc.); process() fulfills them with ceramic textures.
Partial updates are collapsed into a full submitPixels (the only
cross-backend texture update path).
Static Members
imgui
textureId(texture: Texture): imgui.ImTextureID
The ImTextureID for a ceramic texture - use it with ImGui.image()
etc. Registers the texture on first use; the slot is released
automatically when the texture is destroyed.
imgui
textureRef(texture: Texture): imgui.ImTextureRef
An ImTextureRef for a ceramic texture - this is what ImGui.image(),
ImGui.imageButton() etc. take as first argument.
The ceramic texture for an ImTextureID key (null if unknown).
imgui
allTextures(): Array<Texture>
Every registered texture (for Renderable.computeUsedTextures).
Fulfill this frame's ImTextureData requests (called by the renderable,
right before walking the draw lists).
Private Members
imgui
textures: Array<Texture>
id → texture. Index 0 is reserved (ImTextureID_Invalid == 0).
Textures created by the ImTextureData protocol (owned here).
Copy the RGBA pixels out of an ImTextureData, PREMULTIPLYING alpha
(ceramic's whole pipeline is premultiplied; ImGui atlases are straight
alpha - uploading them raw makes empty texels add pure white with our
ONE / ONE_MINUS_SRC_ALPHA blending). Converts Alpha8 when needed.