2023-05-14 10:21:03 +00:00
|
|
|
struct ENGINE_EVENT { char type; void * data; };
|
|
|
|
static char ENGINE_EVENT_TYPE_UNKNOWN = 0;
|
|
|
|
struct ENGINE_EVENT_UNKNOWN { };
|
|
|
|
static char ENGINE_EVENT_TYPE_NONE = 1;
|
|
|
|
struct ENGINE_EVENT_NONE { };
|
|
|
|
static char ENGINE_EVENT_TYPE_EXIT = 2;
|
|
|
|
struct ENGINE_EVENT_EXIT { };
|
2023-05-15 08:41:30 +00:00
|
|
|
static char ENGINE_EVENT_TYPE_INPUTKB = 3;
|
2023-05-14 10:21:03 +00:00
|
|
|
struct ENGINE_EVENT_INPUTKB { char key; char pressed; };
|
|
|
|
|
|
|
|
void * engine_malloc(void * pnt,size_t size) {
|
|
|
|
void * mem = realloc(pnt,size);
|
|
|
|
if (mem == NULL) {
|
|
|
|
printf("ERROR: Could not allocate memory.\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
return mem;
|
|
|
|
}
|
|
|
|
|
|
|
|
void engine_free(void *pnt) {
|
|
|
|
free(pnt);
|
|
|
|
}
|