diff --git a/Cargo.toml b/Cargo.toml index dd7e8d1d721082..f1b0c8c6abc5ba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ readme = "README.md" exclude = ["assets/**/*", "tools/**/*", ".github/**/*", "crates/**/*"] [features] -default = ["bevy_audio", "bevy_gltf", "bevy_wgpu", "bevy_winit", "png", "hdr", "mp3"] +default = ["bevy_audio", "bevy_gltf", "bevy_wgpu", "bevy_winit", "png", "hdr", "mp3", "x11"] profiler = ["bevy_ecs/profiler", "bevy_diagnostic/profiler"] wgpu_trace = ["bevy_wgpu/trace"] @@ -29,6 +29,10 @@ vorbis = ["bevy_audio/vorbis"] serialize = ["bevy_input/serialize"] +# Display server protocol support (X11 is enabled by default) +wayland = ["bevy_winit/wayland"] +x11 = ["bevy_winit/x11"] + [workspace] members = [ "crates/*", diff --git a/README.md b/README.md index e17a91470d8ffa..9cdf07b3782213 100644 --- a/README.md +++ b/README.md @@ -73,4 +73,8 @@ Bevy is only possible because of the hard work put into these foundational techn * [winit](/~https://github.com/rust-windowing/winit): cross platform window creation and management in Rust * [spirv-reflect](/~https://github.com/gwihlidal/spirv-reflect-rs): Reflection API in rust for SPIR-V shader byte code +## [Bevy Cargo Features](docs/cargo_features.md) + +The cargo features provided by Bevy, could be enabled for certain usages. + Additionally, we would like to thank the [Amethyst](/~https://github.com/amethyst/amethyst), [macroquad](/~https://github.com/not-fl3/macroquad), [coffee](/~https://github.com/hecrj/coffee), [ggez](/~https://github.com/ggez/ggez), and [Piston](/~https://github.com/PistonDevelopers/piston) projects for providing solid examples of game engine development in Rust. If you are looking for a Rust game engine, it is worth considering all of your options. Each engine has different design goals and some will likely resonate with you more than others. diff --git a/crates/bevy_winit/Cargo.toml b/crates/bevy_winit/Cargo.toml index 449c4fdb7bda09..955538086932ad 100644 --- a/crates/bevy_winit/Cargo.toml +++ b/crates/bevy_winit/Cargo.toml @@ -9,6 +9,10 @@ repository = "/~https://github.com/bevyengine/bevy" license = "MIT" keywords = ["bevy"] +[features] +wayland = ["winit/wayland"] +x11 = ["winit/x11"] + [dependencies] # bevy bevy_app = { path = "../bevy_app", version = "0.1" } @@ -18,5 +22,5 @@ bevy_math = { path = "../bevy_math", version = "0.1" } bevy_window = { path = "../bevy_window", version = "0.1" } # other -winit = { version = "0.22.2", package = "cart-tmp-winit", default-features = false, features = ["x11"] } +winit = { version = "0.22.2", package = "cart-tmp-winit", default-features = false} log = { version = "0.4", features = ["release_max_level_info"] } \ No newline at end of file diff --git a/docs/cargo_features.md b/docs/cargo_features.md new file mode 100644 index 00000000000000..fb44cd083e8926 --- /dev/null +++ b/docs/cargo_features.md @@ -0,0 +1,61 @@ +# Cargo Features + +## Default Features + +### bevy_audio + +Audio support. All audio formats support depends on this. + +### bevy_gltf + +[glTF](https://www.khronos.org/gltf/) support. + +### bevy_winit + +GUI support. + +### bevy_wgpu + +Make use of GPU via [WebGPU](https://gpuweb.github.io/gpuweb/) support. + +### png + +PNG picture format support. + +### hdr + +[HDR](https://en.wikipedia.org/wiki/High_dynamic_range) support. + +### mp3 + +Audio of mp3 format support. + +### x11 + +Make GUI applications use X11 procotol. You could enable wayland feature to override this. + +## Optional Features + +### profiler + +For profiler. + +### wgpu_trace + +For tracing wgpu. + +### flac + +FLAC audio fromat support. It's included in bevy_audio feature. + +### wav + +WAV audio format support. + +### vorbis + +Vorbis audio format support. + +### wayland + +Enable this to use Wayland display server protocol other than X11. \ No newline at end of file diff --git a/examples/README.md b/examples/README.md index babe33361d621a..ac11720e32a3be 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,7 +1,10 @@ # Examples These examples demonstrate the main features of Bevy and how to use them. -To run an example, use the command `cargo run --example `. +To run an example, use the command `cargo run --example `, and add the option `--features x11` or `--features wayland` to force the example to run on a specific window compositor, e.g. +``` +cargo run --features wayland hello_world +``` ## Hello, World!