From 7cdb4bb159a7df88390e63c59f0d4c5538d7411b Mon Sep 17 00:00:00 2001 From: tcmal Date: Sun, 25 Aug 2024 17:44:20 +0100 Subject: feat(render): add size parameter during stagedbuffer creation --- examples/render-quad/src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'examples/render-quad/src/main.rs') diff --git a/examples/render-quad/src/main.rs b/examples/render-quad/src/main.rs index d0993ea..9cc7310 100644 --- a/examples/render-quad/src/main.rs +++ b/examples/render-quad/src/main.rs @@ -41,10 +41,10 @@ fn main() { let window = WindowBuilder::new().build(&event_loop).unwrap(); let mut ctx = RenderingContext::new(&window).unwrap(); - ctx.vert_buffer[0] = UVPoint(Vector2::new(-0.5, -0.5), Vector3::new(1.0, 0.0, 0.0)); - ctx.vert_buffer[1] = UVPoint(Vector2::new(0.5, -0.5), Vector3::new(0.0, 1.0, 0.0)); - ctx.vert_buffer[2] = UVPoint(Vector2::new(0.5, 0.5), Vector3::new(0.0, 0.0, 1.0)); - ctx.vert_buffer[3] = UVPoint(Vector2::new(-0.5, 0.5), Vector3::new(1.0, 0.0, 1.0)); + ctx.vert_buffer[0] = UVPoint(Vector2::new(-0.5, -0.5), Vector3::new(1.0, 0.0, 0.0), Vector2::new(0.0, 0.0)); + ctx.vert_buffer[1] = UVPoint(Vector2::new(0.5, -0.5), Vector3::new(0.0, 1.0, 0.0), Vector2::new(1.0, 0.0)); + ctx.vert_buffer[2] = UVPoint(Vector2::new(0.5, 0.5), Vector3::new(0.0, 0.0, 1.0), Vector2::new(1.0, 1.0)); + ctx.vert_buffer[3] = UVPoint(Vector2::new(-0.5, 0.5), Vector3::new(1.0, 0.0, 1.0), Vector2::new(0.0, 1.0)); ctx.index_buffer[0] = (0, 1, 2); ctx.index_buffer[1] = (0, 2, 3); @@ -72,7 +72,7 @@ fn main() { let mouse_x: f32 = ((position.x / win_size.width as f64) * 2.0 - 1.0) as f32; let mouse_y: f32 = ((position.y / win_size.height as f64) * 2.0 - 1.0) as f32; - ctx.vert_buffer[0] = UVPoint(Vector2::new(mouse_x, mouse_y), Vector3::new(1.0, 0.0, 0.0)); + ctx.vert_buffer[0] = UVPoint(Vector2::new(mouse_x, mouse_y), Vector3::new(1.0, 0.0, 0.0), Vector2::new(0.0, 0.0)); } Event::MainEventsCleared => { -- cgit v1.2.3