iv/src/utils.rs
Steins7 dd1d214a4a Started implementing triangle pipeline
+ Pipeline new() and drop()
+ Attachement new(() and drop()
+ draw_triangle_frame
! crashes at pipeline creation
2021-01-30 12:05:48 +01:00

25 lines
414 B
Rust

#[allow(unused_imports)]
use log::{debug, error, info, trace, warn};
use num_traits::Num;
#[derive(Debug, Copy, Clone)]
pub struct Rect<I: Num> {
pub w: I,
pub h: I,
}
#[derive(Debug, Copy, Clone)]
pub struct Triangle {
pub points: [[f32; 2]; 3],
}
impl Triangle {
pub fn points_flat(&self) -> [f32; 6] {
let [[a, b], [c, d], [e, f]] = self.points;
[a, b, c, d, e, f]
}
}