Macro texture_receive

Source
macro_rules! texture_receive {
    ( $callback:expr $(,)? ) => { ... };
}
Expand description

Macro to wrap a texture receive callback.

Generates a RawTextureReceiveCallback wrapper around the passed callback.

ยงUsage

use nexus::log::{log, LogLevel};
let texture_receive: RawTextureReceiveCallback = texture_receive!(|id, _texture| {
    log(LogLevel::Info, "My Addon", format!("texture {id} loaded"));
});
load_texture_from_file("MY_TEXTURE", r"C:\path\to\texture.png", Some(texture_receive));