diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-07 14:53:01 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-07 14:53:01 +0100 |
commit | 5c3ce63558f2d5dec06a124773f910d783bb22aa (patch) | |
tree | 77402408eaba5dab3fb5064628dad1a5fd2be0f1 /src/test/InputTest.cpp | |
parent | 1e9e564f3806d07c7b0dc445c4ae2e738350fc83 (diff) | |
parent | fdb4c99e139a264d4e15e6913a3756fc6cccb2f2 (diff) |
merge master
Diffstat (limited to 'src/test/InputTest.cpp')
-rw-r--r-- | src/test/InputTest.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/test/InputTest.cpp b/src/test/InputTest.cpp index cb9833f..a7c0157 100644 --- a/src/test/InputTest.cpp +++ b/src/test/InputTest.cpp @@ -60,8 +60,8 @@ protected: TEST_F(InputTest, MouseDown) { GameObject obj = mgr.new_object("camera", "camera", vec2{0, 0}, 0, 1); - auto & camera = obj.add_component<Camera>(Color::BLACK, ivec2{0, 0}, vec2{500, 500}, 0.0, - vec2{0, 0}); + auto & camera = obj.add_component<Camera>( + ivec2{100, 100}, vec2{100, 100}, Camera::Data{.bg_color = Color::WHITE, .zoom = 1.0f}); camera.active = true; bool mouse_triggered = false; EventHandler<MousePressEvent> on_mouse_down = [&](const MousePressEvent & event) { @@ -90,8 +90,8 @@ TEST_F(InputTest, MouseDown) { TEST_F(InputTest, MouseUp) { GameObject obj = mgr.new_object("camera", "camera", vec2{0, 0}, 0, 1); - auto & camera = obj.add_component<Camera>(Color::BLACK, ivec2{0, 0}, vec2{500, 500}, 0.0, - vec2{0, 0}); + auto & camera = obj.add_component<Camera>( + ivec2{100, 100}, vec2{100, 100}, Camera::Data{.bg_color = Color::WHITE, .zoom = 1.0f}); camera.active = true; bool function_triggered = false; EventHandler<MouseReleaseEvent> on_mouse_release = [&](const MouseReleaseEvent & e) { @@ -118,8 +118,8 @@ TEST_F(InputTest, MouseUp) { TEST_F(InputTest, MouseMove) { GameObject obj = mgr.new_object("camera", "camera", vec2{0, 0}, 0, 1); - auto & camera = obj.add_component<Camera>(Color::BLACK, ivec2{0, 0}, vec2{500, 500}, 0.0, - vec2{0, 0}); + auto & camera = obj.add_component<Camera>( + ivec2{100, 100}, vec2{100, 100}, Camera::Data{.bg_color = Color::WHITE, .zoom = 1.0f}); camera.active = true; bool function_triggered = false; EventHandler<MouseMoveEvent> on_mouse_move = [&](const MouseMoveEvent & e) { @@ -148,8 +148,8 @@ TEST_F(InputTest, MouseMove) { TEST_F(InputTest, KeyDown) { GameObject obj = mgr.new_object("camera", "camera", vec2{0, 0}, 0, 1); - auto & camera = obj.add_component<Camera>(Color::BLACK, ivec2{0, 0}, vec2{500, 500}, 0.0, - vec2{0, 0}); + auto & camera = obj.add_component<Camera>( + ivec2{100, 100}, vec2{100, 100}, Camera::Data{.bg_color = Color::WHITE, .zoom = 1.0f}); camera.active = true; bool function_triggered = false; @@ -179,8 +179,8 @@ TEST_F(InputTest, KeyDown) { TEST_F(InputTest, KeyUp) { GameObject obj = mgr.new_object("camera", "camera", vec2{0, 0}, 0, 1); - auto & camera = obj.add_component<Camera>(Color::BLACK, ivec2{0, 0}, vec2{500, 500}, 0.0, - vec2{0, 0}); + auto & camera = obj.add_component<Camera>( + ivec2{100, 100}, vec2{100, 100}, Camera::Data{.bg_color = Color::WHITE, .zoom = 1.0f}); camera.active = true; bool function_triggered = false; EventHandler<KeyReleaseEvent> on_key_release = [&](const KeyReleaseEvent & event) { @@ -203,8 +203,8 @@ TEST_F(InputTest, KeyUp) { TEST_F(InputTest, MouseClick) { GameObject obj = mgr.new_object("camera", "camera", vec2{0, 0}, 0, 1); - auto & camera = obj.add_component<Camera>(Color::BLACK, ivec2{0, 0}, vec2{500, 500}, 0.0, - vec2{0, 0}); + auto & camera = obj.add_component<Camera>( + ivec2{100, 100}, vec2{100, 100}, Camera::Data{.bg_color = Color::WHITE, .zoom = 1.0f}); camera.active = true; bool on_click_triggered = false; EventHandler<MouseClickEvent> on_mouse_click = [&](const MouseClickEvent & event) { @@ -224,8 +224,8 @@ TEST_F(InputTest, MouseClick) { TEST_F(InputTest, testButtonClick) { GameObject obj = mgr.new_object("camera", "camera", vec2{0, 0}, 0, 1); - auto & camera = obj.add_component<Camera>(Color::BLACK, ivec2{0, 0}, vec2{500, 500}, 0.0, - vec2{0, 0}); + auto & camera = obj.add_component<Camera>( + ivec2{100, 100}, vec2{100, 100}, Camera::Data{.bg_color = Color::WHITE, .zoom = 1.0f}); camera.active = true; GameObject button_obj = mgr.new_object("body", "person", vec2{0, 0}, 0, 1); bool button_clicked = false; @@ -251,8 +251,8 @@ TEST_F(InputTest, testButtonClick) { TEST_F(InputTest, testButtonHover) { GameObject obj = mgr.new_object("camera", "camera", vec2{0, 0}, 0, 1); - auto & camera = obj.add_component<Camera>(Color::BLACK, ivec2{0, 0}, vec2{500, 500}, 0.0, - vec2{0, 0}); + auto & camera = obj.add_component<Camera>( + ivec2{100, 100}, vec2{100, 100}, Camera::Data{.bg_color = Color::WHITE, .zoom = 1.0f}); camera.active = true; GameObject button_obj = mgr.new_object("body", "person", vec2{0, 0}, 0, 1); bool button_clicked = false; |