Skip to content
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

Merged
merged 4 commits into from
Jun 11, 2017
Merged

Replace cgmath bindings by mint #1301

merged 4 commits into from
Jun 11, 2017

Conversation

vitvakatu
Copy link
Contributor

Closes #1290

Unfortunately (or maybe not), Rad and Deg types were removed.

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.
Copy link
Member

@kvark kvark left a 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

@@ -29,14 +29,13 @@ path = "src/lib.rs"

[dependencies]
bitflags = "0.8"
cgmath = { version = "0.14", optional = true }
mint = { version = "0.3", optional = true }
Copy link
Member

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

use cgmath::{Deg, Matrix2, Matrix3, Matrix4, Point2, Point3, Rad, Vector2, Vector3, Vector4};
#[cfg(feature = "mint")]
use mint::{
Point2, Point3,
Copy link
Member

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

serialize = ["gfx_core/serialize", "draw_state/serialize"]
unstable = []

[dependencies]
cgmath = { version = "0.14", optional = true }
mint = { version = "0.3", optional = true }
Copy link
Member

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"

use cgmath::{Deg, Matrix2, Matrix3, Matrix4, Rad, Point2, Point3, Vector2, Vector3, Vector4};
#[cfg(feature = "mint")]
use mint::{
Point2, Point3,
Copy link
Member

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

@vitvakatu
Copy link
Contributor Author

Appveyor nightly fails because of rust-lang/rust#42544
I had the same problem on my local machine

@kvark
Copy link
Member

kvark commented Jun 11, 2017

Wonderful, thank you!

@kvark kvark merged commit 50f6715 into gfx-rs:master Jun 11, 2017
@kvark kvark mentioned this pull request Jun 11, 2017
10 tasks
@vitvakatu vitvakatu deleted the mint branch June 11, 2017 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants