diff options
Diffstat (limited to 'engine/src/vertex.rs')
| -rw-r--r-- | engine/src/vertex.rs | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/engine/src/vertex.rs b/engine/src/vertex.rs deleted file mode 100644 index 30640c4..0000000 --- a/engine/src/vertex.rs +++ /dev/null @@ -1,69 +0,0 @@ -use std::mem::size_of; - -use crate::util::builder; -use crate::vector::{Vec2, Vec3}; - -builder! { -#[builder(name = Builder, derives = (Debug, Default))] -#[derive(Debug, Clone, Default, PartialEq)] -#[repr(C)] -#[non_exhaustive] -pub struct Vertex -{ - pub pos: Vec3<f32>, - pub texture_coords: Vec2<f32>, - pub normal: Vec3<f32>, -} -} - -impl Vertex -{ - pub(crate) fn attrs() -> &'static [Attribute] - { - #[allow(clippy::cast_possible_truncation)] - &[ - Attribute { - index: 0, - component_type: AttributeComponentType::Float, - component_cnt: AttributeComponentCnt::Three, - component_size: size_of::<f32>() as u32, - }, - Attribute { - index: 1, - component_type: AttributeComponentType::Float, - component_cnt: AttributeComponentCnt::Two, - component_size: size_of::<f32>() as u32, - }, - Attribute { - index: 2, - component_type: AttributeComponentType::Float, - component_cnt: AttributeComponentCnt::Three, - component_size: size_of::<f32>() as u32, - }, - ] - } -} - -pub(crate) struct Attribute -{ - pub(crate) index: u32, - pub(crate) component_type: AttributeComponentType, - pub(crate) component_cnt: AttributeComponentCnt, - pub(crate) component_size: u32, -} - -pub(crate) enum AttributeComponentType -{ - Float, -} - -#[derive(Debug, Clone, Copy)] -#[repr(u32)] -#[allow(dead_code)] -pub(crate) enum AttributeComponentCnt -{ - One = 1, - Two = 2, - Three = 3, - Four = 4, -} |
