engine/skybox/src/vertex.rs

32 lines
708 B
Rust
Raw Normal View History

2025-03-01 17:05:27 +00:00
use engine::prelude::*;
use utilities::impl_reprc;
impl_reprc!(
pub struct VertexPoint {
#[assume_reprc]
v: [f32; 4],
}
);
impl VertexPoint {
pub fn new(x: impl Into<f32>, y: impl Into<f32>, z: impl Into<f32>) -> Self {
VertexPoint {
v: [x.into(), y.into(), z.into(), 1.0],
}
}
}
impl VertexInputDescription for VertexPoint {
fn attributes() -> Vec<VkVertexInputAttributeDescription> {
vec![
// position
VkVertexInputAttributeDescription {
location: 0,
binding: 0,
format: VK_FORMAT_R32G32B32_SFLOAT,
offset: 0,
},
]
}
}