KROYSDOCS
HomeWhat's newv0.1.0
C/C++ SDK / C ABI · Viewport (editor, 2.1; capability viewport-tools) / KroysViewportToolCallbacks

KroysViewportToolCallbacks

The hooks of a viewport tool (main thread).

Kindstruct
Headerkroys/kroys_plugin.h
Members6
Functions3
DECLARATION

Declaration

Declared in kroys/kroys_plugin.h.

kroys_plugin.h
typedef struct KroysViewportToolCallbacks { ... } KroysViewportToolCallbacks;
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
#void (KROYS_CALL* OnActivate)(void* userData, int32_t active);

The tool became active (1) or inactive (0).

function pointer
#int32_t (KROYS_CALL* OnInput)(void* userData, const KroysViewportInput* input);

Active tool only. Nonzero: the input is consumed (no selection click).

function pointer
#void (KROYS_CALL* Draw)(void* userData, const KroysDrawArgs* args);

Draw with viewport->Draw*.

function pointer
Members
uint32_t structSize;
uint32_t reserved;
void* userData;
void (KROYS_CALL* OnActivate)(void* userData, int32_t active);
int32_t (KROYS_CALL* OnInput)(void* userData, const KroysViewportInput* input);
void (KROYS_CALL* Draw)(void* userData, const KroysDrawArgs* args);

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