Fumofumotris/source/fumoengine/fumoengine.c
Julia 2b15552401 a
a
2024-05-06 22:29:10 -05:00

33 lines
620 B
C

#include "fumoengine.h"
#include "platform.h"
void Panic(char *message)
{
printf(message);
exit(1);
}
void InvokeUpdate(void_func func, void *arg)
{
struct { nsec frametime; } *args = arg;
((update_func)func)(args->frametime);
}
bool FumoInit(struct FumoGame *game)
{
if (!PlatformInit())
Panic("Platform failed to initialize");
if (!CreateController(&game->ctrl))
Panic("Out of memory");
if (!CreateEvent(&game->update))
Panic("Out of memory");
if (!BeginInputThread(&game->input_hand))
Panic("Input handle failed to initialize");
return 0;
}