Skip to content

Commit

Permalink
add an option about display server protocol, and create document `doc…
Browse files Browse the repository at this point in the history
…s/cargo_features.md` (bevyengine#249)

add an option about display server protocol, and create document `docs/cargo_features.md`
  • Loading branch information
VitalyAnkh authored and BimDav committed Aug 26, 2020
1 parent 0b838fd commit ccd06de
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand All @@ -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/*",
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 5 additions & 1 deletion crates/bevy_winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -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"] }
61 changes: 61 additions & 0 deletions docs/cargo_features.md
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 4 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
@@ -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 <Example>`.
To run an example, use the command `cargo run --example <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!

Expand Down

0 comments on commit ccd06de

Please sign in to comment.