diff options
author | Juan Manuel Tomás <jtomas1815@gmail.com> | 2021-01-17 18:17:57 -0300 |
---|---|---|
committer | Juan Manuel Tomás <jtomas1815@gmail.com> | 2021-01-17 18:17:57 -0300 |
commit | b25771270f0fd1fe20432ce2c1a671a04bb57a50 (patch) | |
tree | fd1cade5f3a69d9acaa8080d6da43b9dd09382d4 /src/main.rs | |
parent | bc4d45fa639e32394081f726cbb1f093eb469b0a (diff) | |
download | bezier-b25771270f0fd1fe20432ce2c1a671a04bb57a50.tar.gz bezier-b25771270f0fd1fe20432ce2c1a671a04bb57a50.zip |
Refactor function lp into lerp method to_poly
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs index a9bfcf9..ee508e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -112,8 +112,8 @@ fn compile_bezier_shader(a: Poly, b: Poly) -> GLuint { } fn main() { - let a = lerp::lp(Lerp::new(vec![200.0, 500.0, 500.0])); - let b = lerp::lp(Lerp::new(vec![200.0, 500.0, 200.0])); + let a = Lerp::new(vec![200.0, 500.0, 500.0]).to_poly(); + let b = Lerp::new(vec![200.0, 500.0, 200.0]).to_poly(); let sdl_context = sdl2::init().unwrap(); let video_subsystem = sdl_context.video().unwrap(); @@ -141,10 +141,7 @@ fn main() { gl::Viewport(0, 0, window_w as i32, window_h as i32); } - let vertices: [f32; 18] = [ - 1.0, 1.0, 0.0, 1.0, -1.0, 0.0, -1.0, 1.0, 0.0, 1.0, -1.0, 0.0, -1.0, -1.0, 0.0, -1.0, 1.0, - 0.0, - ]; + let vertices: [f32; 18] = [1.0, 1.0, 0.0, 1.0, -1.0, 0.0, -1.0, 1.0, 0.0, 1.0, -1.0, 0.0, -1.0, -1.0, 0.0, -1.0, 1.0, 0.0]; let mut vbo: GLuint = 0; let mut vao: GLuint = 0; |