natiny_resource_get_data

C
const uint8_t* natiny_resource_get_data(NatinyResource resource);

Returns the raw bytes of a loaded resource.

Parameters

Name Type Description
resource NatinyResource Resource handle from natiny_resource_load

Returns

Type Description
const uint8_t* Pointer to resource data, or NULL for an invalid handle

Example

C
NatinyResource res = natiny_resource_load("data/file.bin");
const uint8_t* data = natiny_resource_get_data(res);

Notes

  • The pointer is owned by the resource and remains valid only until that resource is destroyed or natiny_resource_shutdown() is called.