KROYSDOCS
HomeWhat's newv0.1.0
C/C++ SDK / C ABI · Editor / KroysAssetTypeCallbacks

KroysAssetTypeCallbacks

The hooks of a plugin asset type (all optional; main thread).

Kindstruct
Headerkroys/kroys_plugin.h
Members7
Functions4
DECLARATION

Declaration

Declared in kroys/kroys_plugin.h.

kroys_plugin.h
typedef struct KroysAssetTypeCallbacks { ... } KroysAssetTypeCallbacks;
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
#void* userData;

Plugin-owned pointer passed back unchanged to every callback of this table; the host never dereferences it.

field
Functions
#KroysResult (KROYS_CALL* CreateDefault)(void* userData, const KroysByteSink* sink);

Save hook for a new asset: write its initial bytes.

function pointer
#KroysResult (KROYS_CALL* Load)(void* userData, const char* path, const void* bytes, size_t size, char* summary, uint32_t summaryCapacity);

Load hook: validate bytes and describe the asset in summary (Content Browser).

function pointer
#KroysResult (KROYS_CALL* Open)(void* userData, const char* path);

Opened from the Content Browser (double click).

function pointer
#KroysResult (KROYS_CALL* Save)(void* userData, const char* path, const KroysByteSink* sink);

Save hook for an asset marked dirty (editor->MarkAssetDirty): write its bytes.

function pointer
Members
uint32_t structSize;
uint32_t reserved;
void* userData;
KroysResult (KROYS_CALL* CreateDefault)(void* userData, const KroysByteSink* sink);
KroysResult (KROYS_CALL* Load)(void* userData, const char* path, const void* bytes, size_t size, char* summary, uint32_t summaryCapacity);
KroysResult (KROYS_CALL* Open)(void* userData, const char* path);
KroysResult (KROYS_CALL* Save)(void* userData, const char* path, const KroysByteSink* sink);

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