use crate::structs::{ClearColorValue, ClearDepthStencilValue, ClearValue};
impl ClearColorValue {
#[inline]
pub const fn from_float32(rgba: [f32; 4]) -> Self {
Self { float32: rgba }
}
#[inline]
pub const fn from_int32(rgba: [i32; 4]) -> Self {
Self { int32: rgba }
}
#[inline]
pub const fn from_uint32(rgba: [u32; 4]) -> Self {
Self { uint32: rgba }
}
}
impl ClearValue {
#[inline]
pub const fn color_f32(rgba: [f32; 4]) -> Self {
Self {
color: ClearColorValue::from_float32(rgba),
}
}
#[inline]
pub const fn color_i32(rgba: [i32; 4]) -> Self {
Self {
color: ClearColorValue::from_int32(rgba),
}
}
#[inline]
pub const fn color_u32(rgba: [u32; 4]) -> Self {
Self {
color: ClearColorValue::from_uint32(rgba),
}
}
#[inline]
pub const fn depth_stencil(depth: f32, stencil: u32) -> Self {
Self {
depth_stencil: ClearDepthStencilValue { depth, stencil },
}
}
}