// renders a 1x1 quad in NDC with manually calculated tangent vectors
renders a 1x1 quad in NDC with manually calculated tangent vectors
renders a 1x1 quad in NDC with manually calculated tangent vectors
fn render_quad(quadvao: &mut u32, quadvbo: &mut u32) {
    if *quadvao == 0 {
        let quad_vertices: [f32; 20] = [
            // positions     // texture Coords
            -1.0, 1.0, 0.0, 0.0, 1.0, -1.0, -1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 1.0, 1.0, 1.0, -1.0, 0.0, 1.0, 0.0,
        ];
        // setup plane vao
        *quadvao = gl::gen_vertex_array();
        *quadvbo = gl::gen_buffer();
        gl::bind_vertex_array(*quadvao);
        gl::bind_buffer(GL_ARRAY_BUFFER, *quadvbo);
        gl::buffer_data(GL_ARRAY_BUFFER, &quad_vertices, GL_STATIC_DRAW);
        let stride = 5 * mem::size_of::<f32>() as i32;
        gl::enable_vertex_attrib_array(0);
        gl::vertex_attrib_pointer_offset(0, 3, GL_FLOAT, false, stride, 0);
        gl::enable_vertex_attrib_array(1);
        gl::vertex_attrib_pointer_offset(1, 2, GL_FLOAT, false, stride, 3 * mem::size_of::<f32>() as u32);
    }
    gl::bind_vertex_array(*quadvao);
    gl::draw_arrays(GL_TRIANGLE_STRIP, 0, 4);
    gl::bind_vertex_array(0);
}
fn render_quad ( quadvao : & mut u32 , quadvbo : & mut u32 ) { if * quadvao == 0 { let quad_vertices : [ f32 ; 20 ] = [ // positions     // texture Coords - 1.0 , 1.0 , 0.0 , 0.0 , 1.0 , - 1.0 , - 1.0 , 0.0 , 0.0 , 0.0 , 1.0 , 1.0 , 0.0 , 1.0 , 1.0 , 1.0 , - 1.0 , 0.0 , 1.0 , 0.0 , ] ; // setup plane vao * quadvao = gl :: gen_vertex_array ( ) ; * quadvbo = gl :: gen_buffer ( ) ; gl :: bind_vertex_array ( * quadvao ) ; gl :: bind_buffer ( GL_ARRAY_BUFFER , * quadvbo ) ; gl :: buffer_data ( GL_ARRAY_BUFFER , & quad_vertices , GL_STATIC_DRAW ) ; let stride = 5 * mem :: size_of :: < f32 > ( ) as i32 ; gl :: enable_vertex_attrib_array ( 0 ) ; gl :: vertex_attrib_pointer_offset ( 0 , 3 , GL_FLOAT , false , stride , 0 ) ; gl :: enable_vertex_attrib_array ( 1 ) ; gl :: vertex_attrib_pointer_offset ( 1 , 2 , GL_FLOAT , false , stride , 3 * mem :: size_of :: < f32 > ( ) as u32 ) ; } gl :: bind_vertex_array ( * quadvao ) ; gl :: draw_arrays ( GL_TRIANGLE_STRIP , 0 , 4 ) ; gl :: bind_vertex_array ( 0 ) ; }
renders a 1x1 quad in NDC with manually calculated tangent vectors
renders a 1x1 quad in NDC with manually calculated tangent vectors
quadvao
&mut u32
quadvbo
&mut u32