-
Notifications
You must be signed in to change notification settings - Fork 0
/
Game.h
35 lines (28 loc) · 623 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
#pragma once
#include <memory>
#include <string>
#include <SFML/Graphics.hpp>
#include "StateMachine.h"
#include "AssetManager.h"
#include "InputManager.h"
namespace EnglishEducator
{
struct GameData
{
StateMachine machine;
sf::RenderWindow window;
AssetManager assets;
InputManager input;
};
typedef std::shared_ptr<GameData> GameDataRef;
class Game
{
public:
Game(int width, int height, std::string title);
private:
const float dt = 1.0 / 30.0f; // 60 times per second
sf::Clock _clock;
GameDataRef _data = std::make_shared<GameData>();
void Run();
};
}