-
Notifications
You must be signed in to change notification settings - Fork 0
/
Globals.h
53 lines (43 loc) · 1.19 KB
/
Globals.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
#ifndef __GLOBALS_H__
#define __GLOBALS_H__
#include "MemLeaks.h"
#include "SDL/include/SDL_rect.h"
#define LOG(format, ...) log(__FILE__, __LINE__, format, __VA_ARGS__);
void log(const char file[], int line, const char* format, ...);
#define MIN( a, b ) ( ((a) < (b)) ? (a) : (b) )
#define MAX( a, b ) ( ((a) > (b)) ? (a) : (b) )
enum update_status
{
UPDATE_CONTINUE = 1,
UPDATE_STOP,
UPDATE_ERROR
};
// Useful typedefs ---------
typedef unsigned int uint;
// Deletes a buffer
#define RELEASE( x ) \
{ \
if( x != nullptr ) \
{ \
delete x; \
x = nullptr; \
} \
}
// Deletes an array of buffers
#define RELEASE_ARRAY( x ) \
{ \
if( x != nullptr ) \
{ \
delete[] x; \
x = nullptr; \
} \
\
}
// Configuration -----------
#define SCREEN_SIZE 1
#define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 448
#define FULLSCREEN false
#define VSYNC true
#define TITLE "Super off road"
#endif //__GLOBALS_H__