Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
RenderSystem.hpp
Go to the documentation of this file.
1
8#ifndef RTYPE_RENDER_SYSTEM_HPP_
9 #define RTYPE_RENDER_SYSTEM_HPP_
10
11 #include "RType/ECS/Registry.hpp"
12 #include "RType/Logger.hpp"
13 #include "RType/ECS/ISystem.hpp"
14
15 #include <SFML/Graphics.hpp>
16 #include <SFML/System.hpp>
17 #include <unordered_map>
18 #include <vector>
19 #include <algorithm>
20 #include <string>
21
22 /* ECS Components */
27
28namespace rtp::client {
29
30 class RenderSystem : public ecs::ISystem {
31 public:
32 RenderSystem(ecs::Registry& r, sf::RenderWindow& window)
33 : _r(r), _window(window) {}
34
35 void update(float dt) override;
36 void clearTextureCache();
37
38 private:
40 sf::RenderWindow& _window;
41
42 std::unordered_map<std::string, sf::Texture> _textureCache;
43 };
44} // namespace rtp::client
45
46#endif /* !RTYPE_RENDER_SYSTEM_HPP_ */
Interface for ECS systems.
Logger declaration with support for multiple log levels.
RenderSystem(ecs::Registry &r, sf::RenderWindow &window)
void update(float dt) override
Update system logic for one frame.
sf::RenderWindow & _window
std::unordered_map< std::string, sf::Texture > _textureCache
Abstract base class for all ECS systems.
Definition ISystem.hpp:57
R-Type client namespace.