libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
eventsbridge.h
Go to the documentation of this file.
1#pragma once
2
3#include "stdint.h"
5#include "ship/Api.h"
6
7#ifdef __cplusplus
8#include <memory>
9namespace Ship {
10class Events;
11}
16void EventSystemSetEvents(std::shared_ptr<Ship::Events> events);
18std::shared_ptr<Ship::Events> EventSystemGetEvents();
19extern "C" {
20#endif
21
32
47 const char* file, int line);
48
54
65
78API_EXPORT void EventSystemCallEvent(EventID id, void* event, const char* file, int line, const char* key);
79
80#ifdef __cplusplus
81}
82#endif
API export/import macros for cross-platform shared library symbol visibility.
#define API_EXPORT
Marks a symbol for export from (or import into) a shared library.
Definition Api.h:32
EventPriority
Priority levels that control listener dispatch order within an event.
Definition EventTypes.h:19
int32_t EventID
Numeric identifier for an event. -1 is uninitialized, IDs < -1 are internally registered,...
Definition EventTypes.h:8
void(* EventCallback)(IEvent *)
Callback signature for event listeners. The argument is the event payload cast to IEvent*.
Definition EventTypes.h:39
int64_t ListenerID
Numeric identifier for a registered listener; used to unregister later.
Definition EventTypes.h:10
std::shared_ptr< Ship::Events > EventSystemGetEvents()
Returns the current bridged Events component, if any.
API_EXPORT void EventSystemUnregisterListener(EventID ev, ListenerID id)
Removes a previously registered listener.
API_EXPORT void EventSystemCallEvent(EventID id, void *event, const char *file, int line, const char *key)
Fires an event synchronously.
API_EXPORT void EventSystemUnregisterEvent(EventID id)
Removes an event and all listeners registered to it.
void EventSystemSetEvents(std::shared_ptr< Ship::Events > events)
Sets the global Events instance used by the C bridge.
API_EXPORT ListenerID EventSystemRegisterListener(EventID id, EventCallback callback, EventPriority priority, const char *file, int line)
Registers a listener callback for the given event.
API_EXPORT EventID EventSystemRegisterEvent(const char *name)
Registers a new internally managed event type under the given name.
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14