-
Notifications
You must be signed in to change notification settings - Fork 2
/
Game.h
42 lines (40 loc) · 755 Bytes
/
Game.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
#pragma once
#include "common.h"
#include "defines.h"
#include "SDL.h"
#include "TextureManager.h"
#include "InputHandler.h"
#include "Player.h"
class Game {
private:
static Game* instance;
static SDL_Window* window;
static SDL_Renderer* renderer;
static bool running;
TextureManager* tm;
InputHandler* ih;
Player* player;
void update();
void render();
void instructions();
public:
static std::vector<Entity*> entities;
static std::vector<AABB> broadphase;
Game();
static Game* getInstance() {
if (!instance) {
instance = new Game();
}
return instance;
}
static SDL_Window* getWindow() {
return window;
}
static SDL_Renderer* getRenderer() {
return renderer;
}
void init();
void loop();
void clean();
void quit();
};