use std::fmt::Display; use safer_ffi::derive_ReprC; use safer_ffi::layout::ReprC; #[derive(Debug, Clone)] #[derive_ReprC] #[repr(C)] pub struct Matrix { /// Items must be layed out this way for it to work with OpenGL shaders. pub items: [[Value; ROWS]; COLUMNS], } #[derive(Debug, Clone)] #[derive_ReprC] #[repr(C)] pub struct Vec3 { pub x: Value, pub y: Value, pub z: Value, } #[derive(Debug, Clone, Copy)] #[derive_ReprC] #[repr(C)] pub struct Vec2 { pub x: Value, pub y: Value, } #[derive(Debug, Clone, Copy, Default)] pub struct Dimens { pub width: Value, pub height: Value, } impl Display for Dimens { fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(formatter, "{}x{}", self.width, self.height) } }