refactoring

This commit is contained in:
LunarAkai 2025-07-27 10:25:31 +02:00
commit 552a36a146
7 changed files with 282 additions and 130 deletions

View file

@ -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;
}
}