diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-20 14:50:11 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-20 14:50:11 +0100 |
commit | 7e0c99bd2b30500c265370fe71bce3f243a10837 (patch) | |
tree | 895010f77d0df220e54df377c51e112dad4f27b2 /src/example/rendering.cpp | |
parent | e714303c486fb81851116710ba5d68e1b469df02 (diff) | |
parent | f78e8011ee77ba5303a5e608cc81c3b303d35943 (diff) |
merge `master` into `max/unit-tests`
Diffstat (limited to 'src/example/rendering.cpp')
-rw-r--r-- | src/example/rendering.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/example/rendering.cpp b/src/example/rendering.cpp index c9e62f1..ecd3f6a 100644 --- a/src/example/rendering.cpp +++ b/src/example/rendering.cpp @@ -30,14 +30,27 @@ int main() { // Normal adding components { Color color(0, 0, 0, 0); - obj.add_component<Sprite>(make_shared<Texture>("../asset/texture/img.png"), color, - FlipSettings{false, false}); + Sprite & sprite + = obj.add_component<Sprite>(make_shared<Texture>("../asset/texture/img.png"), + color, FlipSettings{false, false}); + sprite.sorting_in_layer = 2; + sprite.order_in_layer = 1; obj.add_component<Camera>(Color::get_red()); } { Color color(0, 0, 0, 0); - obj1.add_component<Sprite>(make_shared<Texture>("../asset/texture/second.png"), color, - FlipSettings{true, true}); + Sprite & sprite = obj1.add_component<Sprite>( + make_shared<Texture>("../asset/texture/img.png"), color, FlipSettings{true, true}); + sprite.sorting_in_layer = 2; + sprite.order_in_layer = 2; + } + + { + Color color(0, 0, 0, 0); + Sprite & sprite = obj2.add_component<Sprite>( + make_shared<Texture>("../asset/texture/img.png"), color, FlipSettings{true, true}); + sprite.sorting_in_layer = 1; + sprite.order_in_layer = 2; } /* @@ -48,8 +61,12 @@ int main() { } */ + sys.update(); + /* + auto start = std::chrono::steady_clock::now(); while (std::chrono::steady_clock::now() - start < std::chrono::seconds(5)) { sys.update(); } + */ } |