From 3d6ca447a7104c499e92fc954affdaf4bf011388 Mon Sep 17 00:00:00 2001 From: Frederico Linhares Date: Fri, 16 Sep 2022 12:03:04 -0300 Subject: feat Create View --- test/src/main.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'test/src') diff --git a/test/src/main.rb b/test/src/main.rb index f5c0676..67ef80c 100644 --- a/test/src/main.rb +++ b/test/src/main.rb @@ -35,8 +35,14 @@ def init() $camera_position = CandyGear::Vector3D.new(0.0, 0.0, 0.0); $camera_rotation = CandyGear::Rotation3D.new(0.0, 0.0, 0.0); - CandyGear.camera_position = $camera_position; - CandyGear.camera_rotation = $camera_rotation; + + color = CandyGear::Vector3D.new(0.12, 0.12, 0.18); + $view1 = CandyGear::View.new(CandyGear::Vector4D.new(0, 0, 1280, 360)); + $view2 = CandyGear::View.new(CandyGear::Vector4D.new(0, 360, 1280, 360)); + CandyGear.views = [$view1, $view2]; + + $view1.camera_position = $camera_position; + $view1.camera_rotation = $camera_rotation; end def key_down(key) @@ -70,7 +76,7 @@ end def quit() = CandyGear.quit(); def tick() - $sprite.draw($sprite_position); + $sprite.draw($view2, $sprite_position); $instances_rotation.rotate(0.0, BOX_ROTATION_SPEED); $instances.each do |i| $model.draw(i, $instances_rotation); -- cgit v1.2.3