Fumofumotris/source/fumoengine/include/event.h
Julia 1dcea1a2cf jjdjd
a
2024-04-30 16:41:31 -05:00

28 lines
505 B
C

#pragma once
#include <iso646.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "fumocommon.h"
union func {
void (*generic)(void *arg);
void (*update)(Time dt);
};
struct Event {
union func *clbks;
size_t len;
size_t capacity;
};
bool CreateEvent(struct Event *event);
bool EventSubscribe(struct Event *event, union func callback);
void EventInvoke(struct Event *event, void *arg);
void EventInvokeUpdate(struct Event *event, Time dt);