-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcgame.h
54 lines (41 loc) · 1.01 KB
/
cgame.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 CGAME_H
#define CGAME_H
#include "SDL.h"
#include "SDL_opengl.h"
#define NO_SDL_GLEXT
#include "SDL_image.h"
#include "SDL_thread.h"
#include "GL/gl.h"
#include "GL/glu.h"
#include "Transformation.h"
#include "ccamera.h"
#include <vector>
using namespace std;
enum GameState{
MAIN_MENU,
RUNNING,
PAUSED,
OVER
};
class CGame
{
private:
SDL_sem *semaphore;
static vector <CGame*> list_of_games;
public:
GameState gameState;
void (* renderScene) (void) ;
CCamera *camera1, *camera2;
void (* eventHandler) (SDL_Event &event) ;
CGame( );
void init( );
void setGameState( GameState gameState );
void setRenderScene( void (* renderScene) (void) );
void callRenderScene( );
void setEventHandler( void (* eventHandler) (SDL_Event &event) );
void callEventHandler(SDL_Event &event);
void setCamera1( CCamera *camera1 );
void setCamera2( CCamera *camera2 );
static CGame* getGameByGameState( GameState gameState );
};
#endif // CGAME_H