Moonhare_Engine/moonhare_engine/src/vertex.rs
2025-07-27 10:25:31 +02:00

26 lines
No EOL
508 B
Rust

use glium::implement_vertex;
#[derive(Copy, Clone)]
pub struct Vertex {
pub position: [f32; 2],
pub color: [f32; 3],
}
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;
}
}