+ Pipeline new() and drop() + Attachement new(() and drop() + draw_triangle_frame ! crashes at pipeline creation
25 lines
414 B
Rust
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]
|
|
}
|
|
}
|
|
|