-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameEngine.h
More file actions
38 lines (35 loc) · 942 Bytes
/
GameEngine.h
File metadata and controls
38 lines (35 loc) · 942 Bytes
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
#pragma once
#include <memory>
#include <iostream>
#include <string>
#include <map>
#include <sfml/Graphics.hpp>
#include "Assets.h"
#include "Physics.h"
class Scene;
class GameEngine
{
/*This class is used to manage scenes.
Data and systems which are shared across various scenes eg. input and rendering.
Assets are loaded and accessed from here.
NOTE : for a larger game engine - you may need to manage asset for individual scenes.
*/
private:
std::map<std::string, std::shared_ptr<Scene>> m_scenes;
sf::RenderWindow m_window;
Assets m_assets;
std::string m_currentScene;
bool m_running = true;
Physics m_physics;
public:
GameEngine(const std::string& configPath);
void init();
void update();
void quit();
std::shared_ptr<Scene> currentScene();
void changeScene(const std::string& name,std::shared_ptr<Scene> scene);
Assets& getAssets();
Physics& getPhysics();
sf::RenderWindow& getWindow();
void sUserInput();
};