pub fn load_vector(&mut self, location: i32, data: Vec<f32>) {
        println!("{}", location);
        unsafe {
            match data.len() {
                2 => gl::Uniform2f(
                    location,
                    *data.get(0).unwrap(),
                    *data.get(1).unwrap()
                ),
                3 => gl::Uniform3f(
                    location,
                    *data.get(0).unwrap(),
                    *data.get(1).unwrap(),
                    *data.get(2).unwrap()
                ),
                4 => gl::Uniform4f(
                    location,
                    *data.get(0).unwrap(),
                    *data.get(1).unwrap(),
                    *data.get(2).unwrap(),
                    *data.get(3).unwrap()
                ),
                _ => ()
            };
        }
    }
// loads vectors up to a length of four into an array
loads vectors up to a length of four into an array
loads vectors up to a length of four into an array
pub fn load_vector(&mut self, location: i32, data: Vec<f32>) {
        println!("{}", location);
        unsafe {
            match data.len() {
                2 => gl::Uniform2f(
                    location,
                    *data.get(0).unwrap(),
                    *data.get(1).unwrap()
                ),
                3 => gl::Uniform3f(
                    location,
                    *data.get(0).unwrap(),
                    *data.get(1).unwrap(),
                    *data.get(2).unwrap()
                ),
                4 => gl::Uniform4f(
                    location,
                    *data.get(0).unwrap(),
                    *data.get(1).unwrap(),
                    *data.get(2).unwrap(),
                    *data.get(3).unwrap()
                ),
                _ => ()
            };
        }
    }
pub fn load_vector ( & mut self , location : i32 , data : Vec < f32 > ) { println ! ( " " location ) ; unsafe { match data . len ( ) { 2 => gl :: Uniform2f ( location , * data . get ( 0 ) . unwrap ( ) , * data . get ( 1 ) . unwrap ( ) ) , 3 => gl :: Uniform3f ( location , * data . get ( 0 ) . unwrap ( ) , * data . get ( 1 ) . unwrap ( ) , * data . get ( 2 ) . unwrap ( ) ) , 4 => gl :: Uniform4f ( location , * data . get ( 0 ) . unwrap ( ) , * data . get ( 1 ) . unwrap ( ) , * data . get ( 2 ) . unwrap ( ) , * data . get ( 3 ) . unwrap ( ) ) , _ => ( ) } ; } }
loads vectors up to a length of four into an array
loads vectors up to a length of four into an array
&mut self
location
i32
data
Vec<f32>
&mut self
location
i32
data
Vec<f32>