Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add an option about display server protocol, and create document docs/cargo_features.md #249

Merged
merged 8 commits into from
Aug 25, 2020
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 @@ -72,4 +72,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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would prefer to leave non-default feature documentation out of the README. Instead, lets create a new docs/features.md file and link to it from the readme.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cart Done! I create a new docs/features.md file and link to it from the readme.

The suggestions in examples/README.md is reversed for I think it's useful for people who are not familiar with cargo.

How do you like it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Just one small set of changes: lets rename the file cargo_features.md, make the title # Cargo Features and then in the main readme make it ## [Bevy Cargo Features](docs/cargo_features.md)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

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