aboutsummaryrefslogtreecommitdiff
path: root/examples/render-quad/src/main.rs
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:20 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:20 +0100
commit7cdb4bb159a7df88390e63c59f0d4c5538d7411b (patch)
tree87867a506fbc0ac0a641080042ee95130209d17d /examples/render-quad/src/main.rs
parent38ec1aa6b22e7e02c4b25c8fbf376b7cf5885009 (diff)
feat(render): add size parameter during stagedbuffer creation
Diffstat (limited to 'examples/render-quad/src/main.rs')
-rw-r--r--examples/render-quad/src/main.rs10
1 files changed, 5 insertions, 5 deletions
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 => {