Skip to content

Commit

Permalink
Presentation edition
Browse files Browse the repository at this point in the history
  • Loading branch information
AJMC2002 committed Nov 15, 2023
1 parent b5db127 commit 7c4ffd2
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 301 deletions.
38 changes: 17 additions & 21 deletions src/graphics/mesh.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
use std::{
mem::{self, size_of},
os::raw::c_void,
ptr,
};
use std::{mem::size_of, ptr};

use gl::types::{GLfloat, GLsizei};
use obj::Obj;
Expand All @@ -11,7 +7,7 @@ use crate::maths::{Matrix, Vector};

use super::{
camera::Camera,
wrapper::{shader_program, ShaderProgram, Texture2D, VertexAttrib, BO, EBO, VAO, VBO},
wrapper::{ShaderProgram, Texture2D, VertexAttrib, BO, EBO, VAO, VBO},
};

pub struct Cube<'a> {
Expand Down Expand Up @@ -42,21 +38,21 @@ impl<'a> Cube<'a> {
-0.5, -0.5, -0.5, //7
];

match texture {
Some(texture) => {
let tex_coords = tex_coords.unwrap_or(vec![
1.0, 1.0, //0
0.0, 1.0, //1
1.0, 0.0, //2
0.0, 0.0, //3
0.0, 1.0, //4
1.0, 1.0, //5
0.0, 0.0, //6
1.0, 0.0, //7
]);
}
None => (),
}
// match texture {
// Some(texture) => {
// let tex_coords = tex_coords.unwrap_or(vec![
// 1.0, 1.0, //0
// 0.0, 1.0, //1
// 1.0, 0.0, //2
// 0.0, 0.0, //3
// 0.0, 1.0, //4
// 1.0, 1.0, //5
// 0.0, 0.0, //6
// 1.0, 0.0, //7
// ]);
// }
// None => (),
// }

let vao = VAO::new();
let vbo: VBO = BO::new(gl::STATIC_DRAW, vertex_data);
Expand Down
1 change: 1 addition & 0 deletions src/graphics/wrapper/texture.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use gl::types::*;
use image::GenericImageView;

#[derive(Debug)]
pub struct Texture2D {
id: GLuint,
}
Expand Down
Loading

0 comments on commit 7c4ffd2

Please sign in to comment.