ECSTASY
All in the name
Loading...
Searching...
No Matches
main.cpp File Reference
Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Version
1.0.0
Date
2022-11-15

Definition in file main.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 22 of file main.cpp.

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}
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.