This function allocates a unique event ID you can use for user-defined events.
Returns a new event ID.
#include "UltraEngine.h"
using namespace UltraEngine;
int main(int argc, const char* argv[])
{
const EventId EVENT_CUSTOM = AllocEventId();
EmitEvent(EVENT_CUSTOM);
while (PeekEvent())
{
auto ev = WaitEvent();
if (ev.id == EVENT_CUSTOM) Print("Custom event received.");
}
return 0;
}