January 2018
Beginner to intermediate
454 pages
10h 8m
English
By default, you can't use the image module with sdl2, we need to activate it. To do so, we need to update our Cargo.toml file by adding a new section as follows:
[features]
default = ["sdl2/image"]
default means that by default, the following features ("sdl2/image") will be enabled. Now, let's explain what "sdl2/image" means; sdl2 refers to the crate where we want to enable a feature and image is the feature we want to enable.
Of course, if you want to enable a feature on the current project, you don't need the sdl2/ part. Consider the following example:
[features]
network = []
default = ["network"]
As I am sure you understood, it's absolutely possible to chain features activation and even to activate multiple features ...
Read now
Unlock full access