Describe the bug
The hello world example doesn't build.
To Reproduce
copied and pasted the hello world example into a new project, then tried to build it.
Expected behavior
... I expected it to build.
Screenshots or pasted code
matt:~/code/my_first_ggez_app# cargo run
Compiling my_first_ggez_app v0.1.0 (/home/matt/code/my_first_ggez_app)
error[E0277]: the trait bound mint::vector::Point2<f32>: std::convert::From<cgmath::point::Point2<f32>> is not satisfied
--> src/main.rs:46:9
|
46 | graphics::draw(ctx, &self.text, (dest_point,))?;
| ^^^^^^^^^^^^^^ the trait std::convert::From<cgmath::point::Point2<f32>> is not implemented for mint::vector::Point2<f32>
|
= help: the following implementations were found:
= note: required because of the requirements on the impl of std::convert::Into<mint::vector::Point2<f32>> for cgmath::point::Point2<f32>
= note: required because of the requirements on the impl of std::convert::From<(cgmath::point::Point2<f32>,)> for ggez::graphics::drawparam::DrawParam
= note: required because of the requirements on the impl of std::convert::Into<ggez::graphics::drawparam::DrawParam> for (cgmath::point::Point2<f32>,)
= note: required by ggez::graphics::draw
error: aborting due to previous error
For more information about this error, try rustc --explain E0277.
error: Could not compile my_first_ggez_app.
To learn more, run the command again with --verbose.
matt:~/code/my_first_ggez_app#
Hardware and Software:
This is with Stable 1.37 running in Linux
Well that's problematic, let me take a look! Thanks for the report.
Ah, you need to tell the cgmath dependency in your Cargo.toml to use the mint feature, which is what ggez uses for math interoperability:
cgmath = {version= "0.17", features=["mint"]}
That needs to be explained better in the setup docs, thank you!
Most helpful comment
Ah, you need to tell the cgmath dependency in your
Cargo.tomlto use themintfeature, which is what ggez uses for math interoperability:That needs to be explained better in the setup docs, thank you!