Skip to main content

Module asset

Module asset 

Source
Expand description

Pictures: registering the bytes once and drawing them by id.

An asset is not part of the tree. It is bytes that have to reach the Renderer before anything can draw them and have to outlive the frame that does, which is the opposite of a node: a node is re-sent whenever it changes and points at nothing after the call that carried it.

So an asset is registered and forgotten, the way a message is posted and forgotten. It rides out on the batch the current call produces, and everything after that is the id.

Functionsยง

asset
Registers one picture and returns the id an [crate::Image] draws it by.
register_owned
Registers bytes this process built rather than bytes it was compiled with.