R-Type
DrawSystem.hpp
Go to the documentation of this file.
1 /*
2 ** EPITECH PROJECT, 2023
3 ** R-Type
4 ** File description:
5 ** DrawSystem
6 */
7 
8 #ifndef DRAWSYSTEM_HPP_
9 #define DRAWSYSTEM_HPP_
10 #include <memory>
11 #include "Event.hpp"
12 #include "utils/SfmlTypes.hpp"
13 #include "SparseArray.hpp"
17 
18 #ifdef DEBUG
19  #include "Debug.hpp"
20 #endif
21 
22 static const float DEFAULT_FPS_LIMIT = 60.0f;
23 
24 namespace GameEngine
25 {
27  {
28  bool isEvent;
30  };
31 
33  class DrawSystem
34  {
35  public:
40  DrawSystem(EventManager &eventManager, int width = 1920, int height = 1080, std::string title = "default");
41 #ifdef DEBUG
42  DrawSystem(EventManager &eventManager, Debug::DebugMenu &debugMenu, int width = 1920, int height = 1080,
43  std::string title = "default");
44 #endif
46  ~DrawSystem();
47 
53 
54  private:
55  std::shared_ptr<Window> _window;
56  EventManager &_eventManager;
57  float _fpsLimit = DEFAULT_FPS_LIMIT;
58  void _initDrawSystem();
59  void _setFpsLimit(const float &newFpsLimit);
60 #ifdef DEBUG
61  Debug::DebugMenu &_debugMenu;
62 #endif
63  };
64 } // namespace GameEngine
65 
66 #endif /* !DRAWSYSTEM_HPP_ */
Class representing the graphics rendering system.
Definition: DrawSystem.hpp:34
~DrawSystem()
destructor
Definition: DrawSystem.cpp:42
DrawSystem(EventManager &eventManager, int width=1920, int height=1080, std::string title="default")
constructor
Definition: DrawSystem.cpp:34
void operator()(SparseArray< TextComponent > &texts, SparseArray< TextureComponent > &textures, SparseArray< CameraComponent > &cameras)
overloaded of () operator, function that draws the textures on the window
Definition: DrawSystem.cpp:80
class to help create and manage all the event handlers
Definition: Event.hpp:135
Class representing a custom event wrapper for sf::Event.
Definition: SfmlTypes.hpp:29
Array which can have empty indexes.
Definition: SparseArray.hpp:19
Definition: AssetManager.hpp:15
Definition: DrawSystem.hpp:27
bool isEvent
Definition: DrawSystem.hpp:28
SEvent event
Definition: DrawSystem.hpp:29