#include #include "time.h" #include #include #include #include #include #include "all.h" void Root(char * filename) { char path[PATH_MAX], * terminator; if (!realpath(filename, path)) { return; } if ((terminator = strrchr(path, '/'))) { *terminator = '\0'; if(chdir(path)) { abort(); } } } int Update(game_t * game, struct timespec now) { (void) now; PollInputEvents(); if (IsWindowResized()) { game->horizontal = GetScreenWidth(), game->vertical = GetScreenHeight(); GameFrameReset(game); } switch (GetKeyPressed()) { case KEY_ESCAPE: return 1; } return 0; } void Frame(game_t * game, double interpolation) { (void)interpolation; BeginDrawing(); ClearBackground(BLACK); DrawCenteredText(game, 0, 20, WHITE, "Snails are now preparing! %d", rand()); rlDrawRenderBatchActive(); SwapScreenBuffer(); } int Main(int count, char ** arguments) { (void)count; game_t game[1] = {0}; char * program_name = arguments[0]; srand(time(NULL)); Root(program_name); GameInitialize(game, program_name); GameLoop(game); GameDeinitialize(game); return 0; } int main (int count, char ** arguments) __attribute__((alias("Main")));