-
Notifications
You must be signed in to change notification settings - Fork 547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace cgmath bindings by mint
#1301
Conversation
User needs manually set `mint` feature in his dependencies if he wants to use mint types in constant buffers and/or uniforms for shaders.
Now supports both column-major and row-major matrices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, thank you!
Just a few fixes needed before merging
src/core/Cargo.toml
Outdated
@@ -29,14 +29,13 @@ path = "src/lib.rs" | |||
|
|||
[dependencies] | |||
bitflags = "0.8" | |||
cgmath = { version = "0.14", optional = true } | |||
mint = { version = "0.3", optional = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use "0.4.1" here
src/core/src/shade.rs
Outdated
use cgmath::{Deg, Matrix2, Matrix3, Matrix4, Point2, Point3, Rad, Vector2, Vector3, Vector4}; | ||
#[cfg(feature = "mint")] | ||
use mint::{ | ||
Point2, Point3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it makes sense to use all the types explicitly as opposed to a simple use mint;
, given that all the usage is in macros, so there are no ergonomics concerns
src/render/Cargo.toml
Outdated
serialize = ["gfx_core/serialize", "draw_state/serialize"] | ||
unstable = [] | ||
|
||
[dependencies] | ||
cgmath = { version = "0.14", optional = true } | ||
mint = { version = "0.3", optional = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, please use "0.4.1"
src/render/src/shade.rs
Outdated
use cgmath::{Deg, Matrix2, Matrix3, Matrix4, Rad, Point2, Point3, Vector2, Vector3, Vector4}; | ||
#[cfg(feature = "mint")] | ||
use mint::{ | ||
Point2, Point3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similarly, please just do use mint
Appveyor nightly fails because of rust-lang/rust#42544 |
Wonderful, thank you! |
Closes #1290
Unfortunately (or maybe not),
Rad
andDeg
types were removed.