pub fn render(
    shader_program: &GLShaderProgram,
    box_texture: &GlTexture,
    ferris_texture: &GlTexture,
    camera: &Camera,
    vao: &buffer::VertexArray,
    gl_view: &GlShaderUniform,
    gl_projection: &GlShaderUniform,
    gl_model: &GlShaderUniform,
    window_context: &WindowContext,
) {
    unsafe {
        gl::Viewport(0, 0, 1680, 1050);
        gl::Clear(gl::COLOR_BUFFER_BIT | gl::DEPTH_BUFFER_BIT)
    };

    shader_program.use_program();

    let texture_a = GlShaderUniform::new(shader_program, "texture_a");

    texture_a.set_i32(0);

    unsafe {
        gl::ActiveTexture(gl::TEXTURE0);
    }

    box_texture.bind();

    vao.bind();
    // ebo.bind();

    gl_view.set_mat(&camera.get_viewmatrix());
    gl_projection.set_mat(&camera.get_perspectivematrix(window_context));

    let mut model = Mat4f32::identity();
    gl_model.set_mat(&model);

    unsafe {
        gl::DrawArrays(gl::TRIANGLES, 0, 36);
    }

    window_context.window.gl_swap_window();
}
// TODO: The rendering logic takes a lot of parameters, consider creating an abstraction for the
// renderer
The rendering logic takes a lot of parameters, consider creating an abstraction for the
renderer
The rendering logic takes a lot of parameters consider creating an abstraction for the renderer
pub fn render(
    shader_program: &GLShaderProgram,
    box_texture: &GlTexture,
    ferris_texture: &GlTexture,
    camera: &Camera,
    vao: &buffer::VertexArray,
    gl_view: &GlShaderUniform,
    gl_projection: &GlShaderUniform,
    gl_model: &GlShaderUniform,
    window_context: &WindowContext,
) {
    unsafe {
        gl::Viewport(0, 0, 1680, 1050);
        gl::Clear(gl::COLOR_BUFFER_BIT | gl::DEPTH_BUFFER_BIT)
    };
    shader_program.use_program();
    let texture_a = GlShaderUniform::new(shader_program, "texture_a");
    texture_a.set_i32(0);
    unsafe {
        gl::ActiveTexture(gl::TEXTURE0);
    }
    box_texture.bind();
    vao.bind();
    // ebo.bind();
    gl_view.set_mat(&camera.get_viewmatrix());
    gl_projection.set_mat(&camera.get_perspectivematrix(window_context));
    let mut model = Mat4f32::identity();
    gl_model.set_mat(&model);
    unsafe {
        gl::DrawArrays(gl::TRIANGLES, 0, 36);
    }
    window_context.window.gl_swap_window();
}
pub fn render ( shader_program : & GLShaderProgram , box_texture : & GlTexture , ferris_texture : & GlTexture , camera : & Camera , vao : & buffer :: VertexArray , gl_view : & GlShaderUniform , gl_projection : & GlShaderUniform , gl_model : & GlShaderUniform , window_context : & WindowContext , ) { unsafe { gl :: Viewport ( 0 , 0 , 1680 , 1050 ) ; gl :: Clear ( gl :: COLOR_BUFFER_BIT | gl :: DEPTH_BUFFER_BIT ) } ; shader_program . use_program ( ) ; let texture_a = GlShaderUniform :: new ( shader_program , " " ) ; texture_a . set_i32 ( 0 ) ; unsafe { gl :: ActiveTexture ( gl :: TEXTURE0 ) ; } box_texture . bind ( ) ; vao . bind ( ) ; // ebo.bind(); gl_view . set_mat ( & camera . get_viewmatrix ( ) ) ; gl_projection . set_mat ( & camera . get_perspectivematrix ( window_context ) ) ; let mut model = Mat4f32 :: identity ( ) ; gl_model . set_mat ( & model ) ; unsafe { gl :: DrawArrays ( gl :: TRIANGLES , 0 , 36 ) ; } window_context . window . gl_swap_window ( ) ; }
TODO: The rendering logic takes a lot of parameters, consider creating an abstraction for the
renderer
TODO : The rendering logic takes a lot of parameters consider creating an abstraction for the renderer
shader_program
&GLShaderProgram
box_texture
&GlTexture
ferris_texture
&GlTexture
camera
&Camera
vao
&buffer::VertexArray
gl_view
&GlShaderUniform
gl_projection
&GlShaderUniform
gl_model
&GlShaderUniform
window_context
&WindowContext
shader_program
&GLShaderProgram
box_texture
&GlTexture
ferris_texture
&GlTexture
camera
&Camera
vao
&buffer::VertexArray
gl_view
&GlShaderUniform
gl_projection
&GlShaderUniform
gl_model
&GlShaderUniform
window_context
&WindowContext