summary refs log tree commit diff stats
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/main.cpp b/src/main.cpp index dcf8d87..35749f5 100644 --- a/src/main.cpp +++ b/src/main.cpp
@@ -3,10 +3,7 @@
3#include <cstdlib> 3#include <cstdlib>
4#include "renderer.h" 4#include "renderer.h"
5#include "muxer.h" 5#include "muxer.h"
6#include "entity_manager.h" 6#include "game.h"
7#include "components/sprite_renderable.h"
8#include "components/transformable.h"
9#include "systems/rendering.h"
10 7
11int main() 8int main()
12{ 9{
@@ -19,24 +16,8 @@ int main()
19 16
20 // Put this in a block so game goes out of scope before we destroy the renderer 17 // Put this in a block so game goes out of scope before we destroy the renderer
21 { 18 {
22 EntityManager manager; 19 Game game {window};
23 20 game.execute();
24 int player = manager.emplaceEntity();
25 manager.emplaceComponent<SpriteRenderableComponent>(player, "res/Starla.png", 10, 12, 6);
26 manager.emplaceComponent<TransformableComponent>(player, 203, 44, 10, 12);
27
28 std::list<std::unique_ptr<System>> loop;
29 loop.push_back(std::unique_ptr<System>(new RenderingSystem()));
30
31 while (!glfwWindowShouldClose(window))
32 {
33 for (auto& sys : loop)
34 {
35 sys->tick(manager, 1.0);
36 }
37
38 glfwPollEvents();
39 }
40 } 21 }
41 22
42 destroyMuxer(); 23 destroyMuxer();