aboutsummaryrefslogtreecommitdiff
path: root/src/example
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-13 15:56:32 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-13 15:56:32 +0100
commit2933655dea64f11f200f42fe51e58dacc5f160eb (patch)
treedf285acaada7b482e27cdea4555bd91ce0d3d603 /src/example
parent78c370bd6cb37c156d06e098fe4e555a9da9dcee (diff)
parentf2509e89c02894ebd3ad992324eb300103621d26 (diff)
merge `master` into `loek/cleanup`
Diffstat (limited to 'src/example')
-rw-r--r--src/example/rendering.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/example/rendering.cpp b/src/example/rendering.cpp
index cbd7de7..ae21f9a 100644
--- a/src/example/rendering.cpp
+++ b/src/example/rendering.cpp
@@ -1,3 +1,4 @@
+#include "api/Camera.h"
#include <crepe/ComponentManager.h>
#include <crepe/api/GameObject.h>
#include <crepe/system/RenderSystem.h>
@@ -23,26 +24,26 @@ int main() {
auto obj1 = GameObject(1, "name", "tag", Vector2{500, 0}, 1, 0.1);
auto obj2 = GameObject(2, "name", "tag", Vector2{800, 0}, 1, 0.1);
- auto & mgr = AssetManager::get_instance();
// Normal adding components
{
Color color(0, 0, 0, 0);
obj.add_component<Sprite>(
make_shared<Texture>("../asset/texture/img.png"), color,
- FlipSettings{true, true});
+ FlipSettings{false, false});
+ obj.add_component<Camera>(Color::get_red());
}
-
{
Color color(0, 0, 0, 0);
- auto img = mgr.cache<Texture>("../asset/texture/second.png");
- obj1.add_component<Sprite>(img, color, FlipSettings{true, true});
+ obj1.add_component<Sprite>(make_shared<Texture>("../asset/texture/second.png"), color, FlipSettings{true, true});
}
+ /*
{
Color color(0, 0, 0, 0);
auto img = mgr.cache<Texture>("../asset/texture/second.png");
obj2.add_component<Sprite>(img, color, FlipSettings{true, true});
}
+ */
auto & sys = crepe::RenderSystem::get_instance();
auto start = std::chrono::steady_clock::now();