-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameEngine.h
More file actions
55 lines (40 loc) · 1.05 KB
/
GameEngine.h
File metadata and controls
55 lines (40 loc) · 1.05 KB
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
#ifndef GAMEENGINE_H
#define GAMEENGINE_H
#include <SFML/Graphics.hpp>
#include <vector>
#include "FrameClock.h"
class CGameState;
class CGameEngine
{
public:
void Init(const char* title, int width=640, int height=480, bool fullscreen=false);
void Cleanup();
void ChangeState(CGameState* state);
void PushState(CGameState* state);
void PopState();
void HandleEvents();
void Update();
void Draw();
bool Running() { return m_running; }
void Quit() { m_running = false; }
sf::RenderWindow window;
sfx::FrameClock clock;
// the current map (can be set by the menu and then loaded by editor)
//std::string currentMap;
// if a map is loaded
bool mapLoaded = false;
// create a new map on resuming editor?
//bool loadNewMap = false;
// save map on resuming editor?
//bool saveMap = false;
//std::string saveAs;
enum Action { action_new, action_load, action_save, action_none };
Action action = action_none;
std::string map_str;
private:
// the stack of states
std::vector<CGameState*> states;
bool m_running;
bool m_fullscreen;
};
#endif