LDKEventHandler
Callback handling an engine event.
typedef bool(*LDKEventHandler)(const LDKEvent *event, void *optional);
Parameters
event
- Event to inspect or receive.
optional
- Optional used by this operation.
Returns
True if the operation succeeds; false otherwise.
LDKEventQueue
typedef struct{
LDKEventHandler callbacks[LDK_EVENT_HANDLERS_MAX];
LDKEventType mask[LDK_EVENT_HANDLERS_MAX];
void *data[LDK_EVENT_QUEUE_SIZE];
LDKEvent events[LDK_EVENT_QUEUE_SIZE];
u32 numEvents;
u32 numHandlers;
}LDKEventQueue;
LDK_EVENT_HANDLERS_MAX
#define LDK_EVENT_HANDLERS_MAX 32
LDK_EVENT_QUEUE_SIZE
#define LDK_EVENT_QUEUE_SIZE 255
ldk_event_handler_add
Register a callback for engine events.
LDK_API void ldk_event_handler_add(
LDKEventQueue *queue,
LDKEventHandler handler,
LDKEventType mask,
void *optional
);
Parameters
LDKEventQueue *queue
- Queue used by this operation.
LDKEventHandler handler
- Handler called for the corresponding event or diagnostic.
LDKEventType mask
- Mask used by this operation.
void *optional
- Optional used by this operation.
ldk_event_handler_mask_set
Change the event mask associated with a handler.
LDK_API void ldk_event_handler_mask_set(
LDKEventQueue *queue,
LDKEventHandler handler,
LDKEventType mask
);
ldk_event_handler_remove
Remove an engine event callback.
LDK_API void ldk_event_handler_remove(
LDKEventQueue *queue,
LDKEventHandler handler
);
Parameters
LDKEventQueue *queue
- Queue used by this operation.
LDKEventHandler handler
- Handler called for the corresponding event or diagnostic.
ldk_event_queue_broadcast
Broadcast an event to subscribers of its type.
LDK_API void ldk_event_queue_broadcast(LDKEventQueue *queue);
ldk_event_queue_clear
Clear the state of the event queue.
LDK_API void ldk_event_queue_clear(LDKEventQueue *queue);
ldk_event_queue_initialize
Initialize the event queue.
LDK_API bool ldk_event_queue_initialize(LDKEventQueue *queue);
Returns
True if the operation succeeds; false otherwise.
ldk_event_queue_terminate
Shut down the event queue.
LDK_API void ldk_event_queue_terminate(LDKEventQueue *queue);