Skip to content

Commit

Permalink
Upgrade to Bevy 0.14 (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
rparrett authored Jul 4, 2024
1 parent ef1c43b commit e89ef32
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
11 changes: 8 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,33 @@ exclude = [".github"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
webgl2 = ["bevy/webgl2"]
webgpu = ["bevy/webgpu"]

[dependencies.bevy]
version = "0.13"
version = "0.14"
default-features = false
features = ["bevy_render"]

[dependencies]
crossbeam-channel = "0.5.0"

[dev-dependencies.bevy]
version = "0.13"
version = "0.14"
default-features = false
features = [
"android_shared_stdcxx",
"bevy_asset",
"bevy_core_pipeline",
"bevy_pbr",
"bevy_render",
"bevy_state",
"bevy_ui",
"bevy_winit",
"default_font",
"hdr",
"multi-threaded",
"multi_threaded",
"tonemapping_luts",
"ktx2",
"zstd",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ Install [wasm-server-runner](https://github.com/jakobhellermann/wasm-server-runn

```bash
# WebGL
cargo run --example states --target=wasm32-unknown-unknown --features=bevy/webgl2
cargo run --example states --target=wasm32-unknown-unknown --features=webgl2

# WebGPU
cargo run --example states --target=wasm32-unknown-unknown --features=bevy/webgpu
cargo run --example states --target=wasm32-unknown-unknown --features=webgpu
```

## Compatibility
Expand Down
11 changes: 7 additions & 4 deletions examples/states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ struct LoadingOnly;
// This value should be found experimentally by logging `PipelinesReady` in your app
// during normal use and noting the maximum value.
#[cfg(not(target_arch = "wasm32"))]
const EXPECTED_PIPELINES: usize = 8;
const EXPECTED_PIPELINES: usize = 10;
// The value will likely differ on the web due to different implementations of some
// render features.
#[cfg(target_arch = "wasm32")]
#[cfg(all(target_arch = "wasm32", feature = "webgpu", not(feature = "webgl2")))]
const EXPECTED_PIPELINES: usize = 8;
// Note: you must add these features to your app. See `Cargo.toml`.
#[cfg(all(target_arch = "wasm32", feature = "webgl2", not(feature = "webgpu")))]
const EXPECTED_PIPELINES: usize = 6;

fn main() {
Expand Down Expand Up @@ -61,13 +64,13 @@ fn setup_loading_screen(

commands.spawn(PbrBundle {
mesh: meshes.add(Cylinder::default()),
material: materials.add(Color::PINK),
material: materials.add(Color::from(bevy::color::palettes::tailwind::PINK_500)),
..default()
});

commands.spawn(PbrBundle {
mesh: meshes.add(Plane3d::default().mesh().size(10.0, 10.0)),
material: materials.add(Color::rgb(0.6, 0.6, 0.6)),
material: materials.add(Color::from(Srgba::gray(0.6))),
transform: Transform::from_xyz(0., -0.5, 0.),
..default()
});
Expand Down

0 comments on commit e89ef32

Please sign in to comment.