-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
58 lines (46 loc) · 1.25 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* *****************************************
* Project_C *
* And now, it's time to C code ! *
* Game Name : Malloc_Fantasy *
* Player 1 : GALLOT Nirina *
* Player 2 : TALLA Michael *
* Groupe 2 *
* Classe 2A3 *
* *
* Created the 10 December 2020 *
***************************************** */
#include "Headers/prototype.h"
/* Variables uses during the game */
Input input;
int main(int argc,char** argv)
{
unsigned int frameLimit = SDL_GetTicks() + 16;
int go;
// Initialisation de la SDL
init("Malloc Fantasy -v1-");
// Loading ressource
loadGame();
// cleanup at the end
atexit(cleanup);
go=1;
// gameLoop
while(go==1)
{
//keyboard input
gestionInputs(&input);
//renderer
drawGame();
// Gestion des 60 fps (1000ms/60 = 16.6 -> 16
delay(frameLimit);
frameLimit = SDL_GetTicks() + 16;
}
MYSQL *connexion = mysql_init(NULL);
if(connexion== NULL)
{
printf("failed...");
}else
{
printf("success");
}
exit(0);
}