-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvisuals.h
62 lines (51 loc) · 1.71 KB
/
visuals.h
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
59
60
61
62
// SDL2 Model by aurelien.esnard@u-bordeaux.fr
#ifndef MODEL_H
#define MODEL_H
#include <SDL.h>
#include <stdbool.h>
#include <stdio.h>
#include "game.h"
#include "game_aux.h"
#include "game_ext.h"
#include "game_private.h"
#include "game_test.h"
#include "game_tools.h"
typedef struct Env_t Env;
/* **************************************************************** */
#ifdef __ANDROID__
#define PRINT(STR, ...) \
do { \
SDL_Log(STR, ##__VA_ARGS__); \
} while (0)
#define ERROR(STR, ...) \
do { \
SDL_Log(STR, ##__VA_ARGS__); \
exit(EXIT_FAILURE); \
} while (0)
#else
#define PRINT(STR, ...) \
do { \
printf(STR, ##__VA_ARGS__); \
} while (0)
#define ERROR(STR, ...) \
do { \
fprintf(stderr, STR, ##__VA_ARGS__); \
exit(EXIT_FAILURE); \
} while (0)
#endif
/* **************************************************************** */
#define APP_NAME "LIGHT-UP"
#define SCREEN_WIDTH 600
#define SCREEN_HEIGHT 600
#define DELAY 100
#define min(a, b) (a <= b ? a : b)
/* **************************************************************** */
Env* init(SDL_Window* win, SDL_Renderer* ren, int argc, char* argv[], game* g);
void render(SDL_Window* win, SDL_Renderer* ren, Env* env, game g, bool* isMarking);
void clean(Env* env);
bool process(SDL_Window* win, SDL_Renderer* ren, SDL_Event* e, Env* env, game g, bool* isMarking);
int nb_of_blank(game g);
void menu(game* g);
/* **************************************************************** */
/****************************************************************************/
#endif