#[derive(Copy, Clone, Debug, PartialEq)]
pub enum PolyMode {
Points,
WireFrame,
Filled,
}
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum Cull {
Clock,
AntiClock,
}
#[derive(Copy, Clone, Debug, Default, PartialEq)]
pub enum DrawMode {
Points,
Lines,
#[default]
Triangles,
Strip,
}
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum ImgFormat {
R(u8),
RG(u8),
RGB(u8),
RGBA(u8),
}
impl ImgFormat {
pub fn channels(&self) -> u8 {
match self {
ImgFormat::R(_) => 1,
ImgFormat::RG(_) => 2,
ImgFormat::RGB(_) => 3,
ImgFormat::RGBA(_) => 4,
}
}
pub fn bit_depth(&self) -> u8 {
*match self {
ImgFormat::R(bd) => bd,
ImgFormat::RG(bd) => bd,
ImgFormat::RGB(bd) => bd,
ImgFormat::RGBA(bd) => bd,
}
}
pub fn pixel_size(&self) -> u8 {
self.channels() * self.bit_depth() / 8
}
pub fn from(channels: u8, bit_depth: u8) -> ImgFormat {
match channels {
1 => ImgFormat::R(bit_depth),
2 => ImgFormat::RG(bit_depth),
3 => ImgFormat::RGB(bit_depth),
_ => ImgFormat::RGBA(bit_depth),
}
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum ImgFilter {
Closest,
Linear,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum ImgWrap {
Repeat,
Extend,
Clip,
}
#[derive(Clone, Debug, PartialEq)]
pub enum ATTRType {
U8,
I8,
U16,
I16,
U32,
I32,
F32,
F64,
}