KROYSDOCS
HomeWhat's newv0.1.0
C/C++ SDK / C ABI · Tasks (editor) / KroysTaskCallbacks

KroysTaskCallbacks

What a task runs: Run on a worker thread, then Complete and Release on the main thread.

Kindstruct
Headerkroys/kroys_plugin.h
Members6
Functions3
DECLARATION

Declaration

Declared in kroys/kroys_plugin.h.

kroys_plugin.h
typedef struct KroysTaskCallbacks { ... } KroysTaskCallbacks;
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* Run)(void* userData, const KroysTaskJob* job);

Worker thread.

function pointer
#void (KROYS_CALL* Complete)(void* userData, int32_t succeeded, const char* message);

Main thread, after Run (any outcome).

function pointer
#void (KROYS_CALL* Release)(void* userData);

Main thread, exactly once, last: free per-task state here.

function pointer
Members
uint32_t structSize;
uint32_t reserved;
void* userData;
KroysResult (KROYS_CALL* Run)(void* userData, const KroysTaskJob* job);
void (KROYS_CALL* Complete)(void* userData, int32_t succeeded, const char* message);
void (KROYS_CALL* Release)(void* userData);

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