-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
37 lines (32 loc) · 865 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "debugmalloc.h"
#include "lib/rendering.h"
#include "lib/Menu/menu.h"
#include "lib/Game/game.h"
#include "lib/Menu/scoreboard.h"
#include <stdbool.h>
int main(int argc, char *argv[]) {
#ifdef ScalingTest (WINDOW_W % CELL_SIZE != 0 || WINDOW_H % CELL_SIZE != 0)
{
printf("Scaling problems are expected...");
}
#endif
//Init Renderer
GameRenderer myRenderer = InitGameRenderer();
//App loop
while (true) {
enum WindowState wState = OpenMenu(&myRenderer);
if (wState == EXIt)break;
if (wState == GAME) {
StartGame(&myRenderer);
} else if (wState == SCORE_BOARD) {
ShowScoreboard(&myRenderer);
} else {
printf("Unknown app state!, Quiting...");
return 1;
}
}
IMG_Quit();
TTF_Quit();
SDL_Quit();
return 0;
}