In this chapter we’ll make sure that your environment is setup correctly for using Conrod.
Conrod is a Rust library (aka crate), so you’ll need Rust! Conrod tracks the stable branch, so you can be assured that we’ll always be compatible with the latest stable version of rustc.
We also rely on the Rust package manager Cargo for managing dependencies and hosting the latest version of conrod.
The easiest way to acquire both of these is by downloading the Rust installer from the Rust homepage. This installer will install the latest stable version of both rustc and cargo.
Once installed, you can test that rustc and cargo are working by entering
rustc --version and
cargo --version into your command line.
If you’re brand new to Rust, we recommend first checking out The Official Rust Book, or at least keeping it on hand as a reference. It also contains a Getting Started guide with more details on installing Rust, which may be useful in the case that you run into any issues with the above steps.
You can view the examples by cloning the github repository and running the examples. First, open up the command line on your system and follow these steps:
- Clone the repo
git clone https://github.com/PistonDevelopers/conrod.git
- Change to the
conroddirectory that we just cloned
- Build and run an example (with –release optimisations turned on)!
cargo run --release --example all_winit_glium cargo run --release --example canvas cargo run --release --example primitives cargo run --release --example text
Hint: You can get a list of all available examples by running:
cargo run --example
If you ran into any issues with these steps, please let us know by filing an issue at the Conrod issue tracker. Be sure to search for your issue first, as another user may have already encountered your problem.
Otherwise, you’re now ready to use conrod!