-
Notifications
You must be signed in to change notification settings - Fork 2
/
Game.h
46 lines (34 loc) · 878 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
42
43
44
45
46
#ifndef MY_TANKS_IN_LABIRINT_GAME_H
#define MY_TANKS_IN_LABIRINT_GAME_H
#include "MainMenuState.h"
struct Game {
//Constructors/Destructors
Game();
//Functions
static void endApplication();
//Update
void updateDt();
void updateSFMLEvents();
void update();
//Render
void render();
//Core
void run();
private:
//Variables
std::shared_ptr<sf::RenderWindow> window;
sf::Event sfEvent{};
std::vector<sf::VideoMode> videoModes;
sf::ContextSettings windowSettings;
bool fullscreen{};
sf::Clock dtClock;
float dt{};
std::shared_ptr<std::vector<std::shared_ptr<State>>> states;
std::map<std::string, sf::Keyboard::Key> supportedKeys;
//Initialization
void initVariables();
void initWindow();
void initStates();
void initKeys();
};
#endif //MY_TANKS_IN_LABIRINT_GAME_H