diff options
| author | HampusM <hampus@hampusmat.com> | 2026-07-14 14:14:10 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-07-14 14:14:10 +0200 |
| commit | 9f465af5044a4fef0061433e85a4e2c28b0ae61c (patch) | |
| tree | e1e2f9079959dfeeb33f5129d7868a4172cd3c14 /opengl-bindings/src/data_types.rs | |
| parent | 4c6c28656571feb0de0d38e5153ba76d8d52ac83 (diff) | |
feat(opengl-bindings): add texture builder & store_image fn
Diffstat (limited to 'opengl-bindings/src/data_types.rs')
| -rw-r--r-- | opengl-bindings/src/data_types.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/opengl-bindings/src/data_types.rs b/opengl-bindings/src/data_types.rs index 7ead0ab..a6c65fc 100644 --- a/opengl-bindings/src/data_types.rs +++ b/opengl-bindings/src/data_types.rs @@ -1,3 +1,5 @@ +use std::fmt::Display; + use safer_ffi::derive_ReprC; use safer_ffi::layout::ReprC; @@ -20,7 +22,7 @@ pub struct Vec3<Value: ReprC> pub z: Value, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Copy)] #[derive_ReprC] #[repr(C)] pub struct Vec2<Value> @@ -29,9 +31,17 @@ pub struct Vec2<Value> pub y: Value, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Copy, Default)] pub struct Dimens<Value> { pub width: Value, pub height: Value, } + +impl<Value: Display> Display for Dimens<Value> +{ + fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result + { + write!(formatter, "{}x{}", self.width, self.height) + } +} |
