class

Egui::Backend::Sokol::SokolTextureRegistry

Inherits Egui::TextureRegistry < Reference < Object

GPU textures via the shim (sg_make_image/sampler/view); the core sees opaque UInt64 handles only.

Instance methods

create_stream(width : Int32, height : Int32) : UInt64

Create an EMPTY updatable RGBA8 texture for pixels that change every frame (decoded video, camera frames); 0 = failure. Content is undefined until the first #update.

Source
destroy(id : UInt64) : Nil

Release a texture from #register_rgba, #load or #create_stream.

Source
destroy_later(id : UInt64) : Nil

Destroy at END of frame. Raster-cache evictions (Svg#paint) happen while the frame's commands are still being built, and a texture referenced by an already-emitted ImageCmd must survive until the frame is drawn — the sokol backend flushes after its pass; this default destroys immediately (headless draws nothing).

Source
flush_destroys

Run the pending #destroy_later entries (sokol: after the pass).

Source
graphical?

Real GPU textures — Svg#paint engages its raster-texture cache on this flag.

Source
image_size(path : String) : Egui::Vec2 | Nil

Header-only probe (stbi_info shim) — pixel size for layout without decoding the whole image.

Source
load(path : String) : UInt64

Load an image file (PNG/JPEG/…) from disk; 0 = failure.

Source
pending_destroys?

True while #destroy_later entries are pending — the backend must not replay its cached idle-frame commands (they may reference textures awaiting destruction).

Source
register_rgba(width : Int32, height : Int32, data : Bytes) : UInt64

Upload RGBA8 pixel data; returns a texture id (0 = failure).

Source
update(id : UInt64, width : Int32, height : Int32, data : Bytes) : Nil

Push fresh RGBA8 pixels into a texture created by #create_stream (same size it was created with).

Source