Skip to main content

ss_scene_add_texture_png

Function ss_scene_add_texture_png 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn ss_scene_add_texture_png( scene: *mut SsScene, key: u32, data: *const u8, len: usize, ) -> i32
Expand description

ss_scene_add_texture from encoded image bytes (PNG) instead of raw RGBA: the library decodes, premultiplies and uploads.

It carries a PNG decoder for embedded packs anyway, so a C host showing a reference-mode .ssab does not have to bring ImageIO / WIC / libpng along just to hand the pixels over. Reading the file is still the host’s job — nothing here opens one.

Fails with SS_ERROR_INVALID_ARGUMENT when the bytes do not decode, or decode to an image the device cannot hold (see ss_scene_add_texture).

§Safety

data must point at len readable bytes. It is not retained.