GPR5100 - Rollback
Loading...
Searching...
No Matches
engine.h
1#pragma once
2
3#include <memory>
4
5#include <SFML/Graphics/RenderWindow.hpp>
6
7#include "engine/app.h"
8
9namespace core
10{
11
15class Engine
16{
17public:
21 void Run();
22
23 void RegisterApp(App* app);
24 void RegisterSystem(SystemInterface*);
25 void RegisterOnEvent(OnEventInterface*);
26 void RegisterDraw(DrawInterface*);
27 void RegisterDrawImGui(DrawImGuiInterface*);
28protected:
29 void Init();
30 void Update(sf::Time dt) const;
31 void Destroy();
32
33 std::vector<SystemInterface*> systems_;
34 std::vector<OnEventInterface*> eventInterfaces_;
35 std::vector<DrawInterface*> drawInterfaces_;
36 std::vector<DrawImGuiInterface*> drawImGuiInterfaces_;
37 std::unique_ptr<sf::RenderWindow> window_;
38};
39
40} // namespace core
App is an interface for applications that need to init/update/destroy, draw and get event from OS.
Definition: app.h:12
DrawImGuiInterface is an interface used by the Engine to be called when the game loop is drawing ImGu...
Definition: graphics.h:23
DrawInterface is an interface used by the Engine to be called when the game loop is drawing elements ...
Definition: graphics.h:12
Engine is a class that manages the layer between the system and the application and runs the game loo...
Definition: engine.h:16
void Run()
Run is a method that runs the Engine game loop.
Definition: engine.cpp:21
OnEventInterface is an interface to a class that needs to read events from the Engine....
Definition: system.h:26
SystemInterface is an interface to a game system that needs to begin, update and end by the Engine....
Definition: system.h:13