summaryrefslogtreecommitdiff
path: root/opengl-bindings/src/data_types.rs
diff options
context:
space:
mode:
Diffstat (limited to 'opengl-bindings/src/data_types.rs')
-rw-r--r--opengl-bindings/src/data_types.rs14
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)
+ }
+}