From ea1d70c8c28e3b96da6264021fa1c62e28fcd8e4 Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 19 Sep 2025 16:36:57 +0200 Subject: feat: add OpenGL bindings crate --- opengl-bindings/src/data_types.rs | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 opengl-bindings/src/data_types.rs (limited to 'opengl-bindings/src/data_types.rs') diff --git a/opengl-bindings/src/data_types.rs b/opengl-bindings/src/data_types.rs new file mode 100644 index 0000000..7ead0ab --- /dev/null +++ b/opengl-bindings/src/data_types.rs @@ -0,0 +1,37 @@ +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)] +#[derive_ReprC] +#[repr(C)] +pub struct Vec2 +{ + pub x: Value, + pub y: Value, +} + +#[derive(Debug, Clone)] +pub struct Dimens +{ + pub width: Value, + pub height: Value, +} -- cgit v1.2.3-18-g5258