KROYSDOCS
HomeWhat's newv0.1.0
C/C++ SDK / C ABI · Assets / KroysAssetApi

KroysAssetApi

Content files and the asset database.

Kindstruct
Headerkroys/kroys_plugin.h
Members8
Functions6
DECLARATION

Declaration

Declared in kroys/kroys_plugin.h.

kroys_plugin.h
typedef struct KroysAssetApi { ... } KroysAssetApi;
REFERENCE

Members

Fields
#uint32_t structSize;

Size of this struct as the writer compiled it (sizeof); the reader uses it to detect members appended by later minor versions.

field
#uint32_t reserved;

Padding reserved for later use; leave it 0.

field
Functions
#KroysResult (KROYS_CALL* ReadContentFile)(KroysContext context, const char* path, const KroysByteSink* sink);

Reads a content file (content-relative path, '/' separators) into sink. All targets.

function pointer
#KroysResult (KROYS_CALL* ImportFile)(KroysContext context, const char* sourcePath, const char* destinationFolder);

Editor, permission assets.write: imports through plugin importers or the engine's import.

function pointer
#KroysResult (KROYS_CALL* CreateAssetFile)(KroysContext context, const char* folder, const char* fileName, const void* bytes, size_t size);

Editor, permission assets.write: a new file through the asset database (GUID, undoable). A taken name gets " 2", " 3"...

function pointer
#uint32_t (KROYS_CALL* AssetCount)(KroysContext context);

Editor: number of assets in the asset database (built-in assets excluded); 0 elsewhere.

function pointersince 2.2
#KroysResult (KROYS_CALL* GetAssetInfo)(KroysContext context, uint32_t index, KroysAssetInfo* outInfo);

Editor: the asset at index (0 .. AssetCount - 1).

function pointersince 2.2
#KroysResult (KROYS_CALL* ReplaceContentFile)(KroysContext context, const char* path, const void* bytes, size_t size, const char* label);

Editor, permission assets.write: replaces the bytes of an existing content file (content-relative path) as one step of the document's undo history named label; undo restores the previous bytes. The asset reloads.

function pointersince 2.2
Members
uint32_t structSize;
uint32_t reserved;
KroysResult (KROYS_CALL* ReadContentFile)(KroysContext context, const char* path, const KroysByteSink* sink);
KroysResult (KROYS_CALL* ImportFile)(KroysContext context, const char* sourcePath, const char* destinationFolder);
KroysResult (KROYS_CALL* CreateAssetFile)(KroysContext context, const char* folder, const char* fileName, const void* bytes, size_t size);
uint32_t (KROYS_CALL* AssetCount)(KroysContext context);
KroysResult (KROYS_CALL* GetAssetInfo)(KroysContext context, uint32_t index, KroysAssetInfo* outInfo);
KroysResult (KROYS_CALL* ReplaceContentFile)(KroysContext context, const char* path, const void* bytes, size_t size, const char* label);

KroysEngine 0.1.0 documentation, built from the engine repository by Tools/BuildDocsSite.py.