Cross-platform C SDK logo

Cross-platform C SDK

Resource packs

❮ Back
Next ❯
This page has been automatically translated using the Google Translate API services. We are working on improving texts. Thank you for your understanding and patience.

Allows access to resource packages. More information in Resources.


Functions

voidrespack_destroy (...)
const char_t*respack_text (...)
const Image*respack_image (...)
const byte_t*respack_file (...)

respack_destroy ()

Destroy a resource package.

void
respack_destroy(ResPack **pack);
pack

Resource Package. Will be set to NULL after destruction.


respack_text ()

Get a text from a resource package.

const char_t*
respack_text(const ResPack *pack,
             const ResId id);
pack

Resource package.

id

Resource identifier.

Return

UTF8 C string terminated in null character '\0'.


respack_image ()

Get an image of a resource package.

const Image*
respack_image(const ResPack *pack,
              const ResId id);
pack

Resource package.

id

Resource identifier.

Return

Image.

Remarks

This function is added by Draw2D library, which is the one who knows how to manipulate images. It will not be available for projects that depend only on Core. In these cases, it is possible to access the contents of the image file through respack_file.


respack_file ()

Get a pointer to the contents of a file, included in a resource package.

const byte_t*
respack_file(const ResPack *pack,
             const ResId id,
             uint32_t *size);
pack

Resource package.

id

Resource identifier.

size

Get the file size in bytes.

Return

Pointer to file content (raw bytes).

❮ Back
Next ❯