diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-18 15:34:22 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-18 15:34:22 +0100 |
commit | b92da3c729c8fc7c002cb3acbb75c56cb63bd89e (patch) | |
tree | 454b64d31b7e0c9151da88a0d49ee782565f49e9 /src/example/rendering.cpp | |
parent | 8b449e764b5c91cd3cb0c4fa404a290ab295a7ef (diff) | |
parent | 121b64b1cb6cfead5814070c8b0185d3d7308095 (diff) |
Merge branch 'master' of https://github.com/lonkaars/crepe into wouter/events
Diffstat (limited to 'src/example/rendering.cpp')
-rw-r--r-- | src/example/rendering.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/example/rendering.cpp b/src/example/rendering.cpp index e0281f2..c9e62f1 100644 --- a/src/example/rendering.cpp +++ b/src/example/rendering.cpp @@ -2,7 +2,7 @@ #include <crepe/ComponentManager.h> #include <crepe/api/GameObject.h> #include <crepe/system/RenderSystem.h> -#include <crepe/util/log.h> +#include <crepe/util/Log.h> #include <crepe/api/AssetManager.h> #include <crepe/api/Color.h> @@ -20,9 +20,12 @@ using namespace crepe; int main() { dbg_trace(); - auto obj = GameObject(0, "name", "tag", Vector2{0, 0}, 1, 1); - auto obj1 = GameObject(1, "name", "tag", Vector2{500, 0}, 1, 0.1); - auto obj2 = GameObject(2, "name", "tag", Vector2{800, 0}, 1, 0.1); + ComponentManager mgr{}; + RenderSystem sys{mgr}; + + GameObject obj = mgr.new_object("name", "tag", Vector2{0, 0}, 1, 1); + GameObject obj1 = mgr.new_object("name", "tag", Vector2{500, 0}, 1, 0.1); + GameObject obj2 = mgr.new_object("name", "tag", Vector2{800, 0}, 1, 0.1); // Normal adding components { @@ -45,7 +48,6 @@ int main() { } */ - auto & sys = crepe::RenderSystem::get_instance(); auto start = std::chrono::steady_clock::now(); while (std::chrono::steady_clock::now() - start < std::chrono::seconds(5)) { sys.update(); |