Reference

Model

ay2d_load

ay2d_model *ay2d_load(const uint8_t *bytes, size_t len);

Loads an .aom or .moc3 from len bytes. Checks the whole file, then evaluates it once so it is ready to draw. Physics is on if the model has a rig.

Returns the model, or NULL with a reason in ay2d_last_error
Keeps your bytes no; free them when it returns
Thread any, before anything else uses the model

ay2d_free

void ay2d_free(ay2d_model *m);

Frees the model and everything it handed out. NULL is allowed. Call it once, after every thread is done with the model.

ay2d_canvas

ay2d_status ay2d_canvas(const ay2d_model *m, ay2d_canvas_info *out);

The canvas size in pixels and how model units map to it. See Framing the model. Thread: any.

ay2d_parameter_count, ay2d_part_count, ay2d_mesh_count, ay2d_texture_count

uint32_t ay2d_parameter_count(const ay2d_model *m);
uint32_t ay2d_part_count(const ay2d_model *m);
uint32_t ay2d_mesh_count(const ay2d_model *m);
uint32_t ay2d_texture_count(const ay2d_model *m);

How many of each the model has. Every index in the ABI is into one of these. Thread: any.