The first project we are going to see is quite simple. It just shows a geometric shape on the screen and it allows the user to rotate it using the arrow keys:
- To run it as a desktop app, go into the ski folder, and type the following command:
cargo run --release
The --release argument is recommended to optimize the generated code. For this simple example, it is pointless, but in more complex examples, the code generated without specifying it is so inefficient that the resulting app is noticeably slowed down.
- After a few minutes of download and compilation, the following desktop window will appear:
It is just an 800 x 600-pixels white rectangle, with a small purple rectangle and a small indigo triangle on top of it. They represent a monoski with its pointed end, in a snowy ski slope.
- If you press the left or right arrow keys (←/→) on your keyboard, you will see the ski rotate around its tip.
- Now, close this window using the appropriate command...