ECSTASY
All in the name
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1
11
12#include <SFML/Graphics.hpp>
13#include <iostream>
14
19
21
22int main(int argc, char **argv)
23{
24 ecstasy::Registry registry;
25 esf::RenderWindow &window =
26 registry.addResource<esf::RenderWindow>(sf::VideoMode(1280, 720), "ECSTASY SFML integration: basic");
27 registry.addSystem<esf::PollEvents>();
28 (void)argv;
29 (void)argc;
30
31 while (window.get().isOpen()) {
32 window.get().clear(sf::Color::White);
33 registry.runSystems();
34 window.get().display();
35 }
36 return 0;
37}
int main(int argc, char **argv)
Definition main.cpp:22
Associative Map to store entity components.
Registry class definition.
constexpr T & get() noexcept
Get a reference to the object.
Base of an ECS architecture.
Definition Registry.hpp:82
void runSystems()
Run all systems present in the registry.
Definition Registry.cpp:92
R & addResource(Args &&...args)
Add a new resource in the registry.
Definition Registry.hpp:884
S & addSystem(Args &&...args)
Add a new system in the registry.
Definition Registry.hpp:839
Poll events system, polling the events from the RenderWindow resource if present.
SFML integration.
Definition include.hpp:28