refactoring
This commit is contained in:
parent
3a92f526a0
commit
552a36a146
7 changed files with 282 additions and 130 deletions
|
|
@ -1,8 +1,26 @@
|
|||
use glium::implement_vertex;
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
pub(crate) struct Vertex {
|
||||
pub(crate) position: [f32; 2],
|
||||
pub(crate) color: [f32; 3],
|
||||
pub struct Vertex {
|
||||
pub position: [f32; 2],
|
||||
pub color: [f32; 3],
|
||||
}
|
||||
implement_vertex!(Vertex, position, color);
|
||||
implement_vertex!(Vertex, position, color);
|
||||
|
||||
impl Vertex {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
position: [0.0, 0.0],
|
||||
color: [0.0, 0.0, 0.0],
|
||||
}
|
||||
}
|
||||
|
||||
pub fn define_shape(v1: Vertex, v2: Vertex, v3: Vertex) -> Vec<Vertex> {
|
||||
let shape = vec![
|
||||
v1,
|
||||
v2,
|
||||
v3
|
||||
];
|
||||
return shape;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue