// loads a set of vertices to a VAO
loads a set of vertices to a VAO
loads a set of vertices to a VAO
pub fn load_to_vao(
        &mut self,
        vertices: &Vec<f32>,
        indices: &Vec<u32>
    ) -> raw_model::RawModel {
        // gets the vertex count
        let vertex_count = (indices.len() as i32);
        // gets a vao id by creating a vao
        let vao_id = self.create_vao();
        // binds the index buffer
        self.bind_index_buffer(indices);
        // stores the vertices in an attribute list
        self.store_attb_list_data(0, vertices, 3);
        // unbinds the vao
        Loader::unbind_vao();
        // creates the raw model
        let raw_model = raw_model::RawModel::new(
            vao_id,
            vertex_count
        );
        raw_model
    }
pub fn load_to_vao ( & mut self , vertices : & Vec < f32 > , indices : & Vec < u32 > ) -> raw_model :: RawModel { // gets the vertex count let vertex_count = ( indices . len ( ) as i32 ) ; // gets a vao id by creating a vao let vao_id = self . create_vao ( ) ; // binds the index buffer self . bind_index_buffer ( indices ) ; // stores the vertices in an attribute list self . store_attb_list_data ( 0 , vertices , 3 ) ; // unbinds the vao Loader :: unbind_vao ( ) ; // creates the raw model let raw_model = raw_model :: RawModel :: new ( vao_id , vertex_count ) ; raw_model }
loads a set of vertices to a VAO
loads a set of vertices to a VAO
&mut self
vertices
&Vec<f32>
indices
&Vec<u32>