diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 77 |
1 files changed, 13 insertions, 64 deletions
diff --git a/src/main.rs b/src/main.rs index ad59b38..eb89fef 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,16 +8,9 @@ use engine::{Engine, Key, WindowSize}; use tracing::Level; use tracing_subscriber::FmtSubscriber; -const WINDOW_SIZE: WindowSize = WindowSize { - width: 500, - height: 600, -}; +const WINDOW_SIZE: WindowSize = WindowSize { width: 500, height: 600 }; -const BLUE: Color<f32> = Color { - red: 0.0, - blue: 1.0, - green: 0.0, -}; +const BLUE: Color<f32> = Color { red: 0.0, blue: 1.0, green: 0.0 }; fn main() -> Result<(), Box<dyn Error>> { @@ -33,53 +26,25 @@ fn main() -> Result<(), Box<dyn Error>> ObjectId::new(1), &[ VertexBuilder::new() - .pos(Vec3 { - x: -0.5, - y: -0.5, - z: 0.0, - }) - .color(Color { - red: 1.0, - green: 0.0, - blue: 0.0, - }) + .pos(Vec3 { x: -0.5, y: -0.5, z: 0.0 }) + .color(Color { red: 1.0, green: 0.0, blue: 0.0 }) .build() .unwrap(), VertexBuilder::new() - .pos(Vec3 { - x: 0.5, - y: -0.5, - z: 0.0, - }) - .color(Color { - red: 0.0, - green: 1.0, - blue: 0.0, - }) + .pos(Vec3 { x: 0.5, y: -0.5, z: 0.0 }) + .color(Color { red: 0.0, green: 1.0, blue: 0.0 }) .build() .unwrap(), VertexBuilder::new() - .pos(Vec3 { - x: 0.0, - y: 0.5, - z: 0.0, - }) - .color(Color { - red: 0.0, - green: 0.0, - blue: 1.0, - }) + .pos(Vec3 { x: 0.0, y: 0.5, z: 0.0 }) + .color(Color { red: 0.0, green: 0.0, blue: 1.0 }) .build() .unwrap(), ], None, )?; - triangle.translate(Vec3 { - x: 0.0, - y: 0.4, - z: 0.0, - }); + triangle.translate(Vec3 { x: 0.0, y: 0.4, z: 0.0 }); engine.add_object(triangle); @@ -87,38 +52,22 @@ fn main() -> Result<(), Box<dyn Error>> ObjectId::new(2), &[ VertexBuilder::new() - .pos(Vec3 { - x: 0.5, - y: 0.5, - z: 0.0, - }) + .pos(Vec3 { x: 0.5, y: 0.5, z: 0.0 }) .color(BLUE) .build() .unwrap(), VertexBuilder::new() - .pos(Vec3 { - x: 0.5, - y: -0.5, - z: 0.0, - }) + .pos(Vec3 { x: 0.5, y: -0.5, z: 0.0 }) .color(BLUE) .build() .unwrap(), VertexBuilder::new() - .pos(Vec3 { - x: -0.5, - y: -0.5, - z: 0.0, - }) + .pos(Vec3 { x: -0.5, y: -0.5, z: 0.0 }) .color(BLUE) .build() .unwrap(), VertexBuilder::new() - .pos(Vec3 { - x: -0.5, - y: 0.5, - z: 0.0, - }) + .pos(Vec3 { x: -0.5, y: 0.5, z: 0.0 }) .color(BLUE) .build() .unwrap(), |