Fumofumotris/source/fumoengine/fumoengine.c

26 lines
503 B
C
Raw Normal View History

2024-05-02 22:17:37 +00:00
#include "fumoengine.h"
#include "platform.h"
2024-04-30 21:41:31 +00:00
2024-03-25 05:34:59 +00:00
2024-04-19 20:23:11 +00:00
void ErrorExit(char *message)
{
printf(message);
exit(1);
}
2024-05-02 22:17:37 +00:00
bool FumoInit(struct FumoGame *game)
2024-04-09 07:00:48 +00:00
{
2024-04-19 20:23:11 +00:00
if (!PlatformInit())
ErrorExit("Platform failed to initialize");
2024-05-02 22:17:37 +00:00
if (!CreateController(&game->ctrl))
2024-04-19 20:23:11 +00:00
ErrorExit("Out of memory");
2024-04-03 23:31:47 +00:00
2024-05-02 22:17:37 +00:00
if (!CreateEvent(&game->update))
ErrorExit("Out of memory");
2024-04-22 22:13:13 +00:00
2024-05-02 22:17:37 +00:00
if (!BeginInputThread(&game->input_hand))
2024-04-19 20:23:11 +00:00
ErrorExit("Input handle failed to initialize");
2024-04-03 23:31:47 +00:00
2024-03-25 05:34:59 +00:00
return 0;
}