class

Egui::TextureRegistry

Inherits Reference < Object

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?

True when #register_rgba hands out real GPU textures. The Svg raster cache (see Svg#paint) only engages on a graphical backend; the headless dummy paints nothing — specs assert on the bake buffers instead (NanoSvgCr works headless).

Source
image_size(path : String) : Vec2 | Nil

Pixel dimensions of an image file, header-only probe (nil = unknown / unreadable — the headless dummy). Layout-side sizing before/without a #load.

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