Skip to content

Commit

Permalink
Added optional serde support
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob2309 committed Aug 17, 2021
1 parent a5d8542 commit 3efbab1
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gfx-maths"
version = "0.2.1"
version = "0.2.2"
authors = [ "Robin Quint" ]
edition = "2018"
description = "Implementations for the most essential Graphics Math operations"
Expand All @@ -17,6 +17,7 @@ categories = [

[dependencies]
auto_ops = "0.3.0"
serde = { version="1.0.127", features=["derive"], optional=true }

[features]
default = []
Expand Down
1 change: 1 addition & 0 deletions src/mat4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use crate::{Quaternion, Vec3, Vec4};
/// as expected by OpenGL and accepted by all other APIs.
/// To change this, use feature `mat-row-major`
#[derive(Debug, Clone, Copy, PartialEq)]
#[cfg_attr(feature="serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(C)]
pub struct Mat4 {
pub values: [f32; 4*4],
Expand Down
1 change: 1 addition & 0 deletions src/quaternion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::Vec3;
use auto_ops::*;

#[derive(Debug, Clone, Copy, PartialEq)]
#[cfg_attr(feature="serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(C)]
pub struct Quaternion {
pub x: f32,
Expand Down
1 change: 1 addition & 0 deletions src/vec2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::ops::Neg;
use auto_ops::*;

#[derive(Debug, Clone, Copy, PartialEq)]
#[cfg_attr(feature="serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(C)]
pub struct Vec2 {
pub x: f32,
Expand Down
1 change: 1 addition & 0 deletions src/vec3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::ops::Neg;
use auto_ops::*;

#[derive(Debug, Clone, Copy, PartialEq)]
#[cfg_attr(feature="serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(C)]
pub struct Vec3 {
pub x: f32,
Expand Down
1 change: 1 addition & 0 deletions src/vec4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::ops::Neg;
use auto_ops::*;

#[derive(Debug, Clone, Copy, PartialEq)]
#[cfg_attr(feature="serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(C)]
pub struct Vec4 {
pub x: f32,
Expand Down

0 comments on commit 3efbab1

Please sign in to comment.