Skip to content

Commit

Permalink
Upgrade to Bevy 0.13 and prepare for Release (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
rparrett committed Feb 17, 2024
1 parent c8f67ac commit 46b9d40
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
10 changes: 4 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_pipelines_ready"
version = "0.2.0"
version = "0.3.0"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "Bevy plugin for tracking render pipeline status."
Expand All @@ -15,17 +15,15 @@ exclude = [".github"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

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

[dependencies]
crossbeam-channel = "0.5.0"

[dev-dependencies.bevy]
version = "0.12"
version = "0.13"
default-features = false
features = [
"android_shared_stdcxx",
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,23 @@ This is useful for creating a nice loading experience for your Bevy app, especia

See [`examples/states.rs`](examples/states.rs).

## WebGL2 and WebGPU

Install [wasm-server-runner](https://github.com/jakobhellermann/wasm-server-runner).

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

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

## Compatibility

| `bevy_pipelines_ready` | `bevy` |
| :-- | :-- |
| `0.3` | `0.13` |
| `0.2` | `0.12` |
| `0.1` | `0.11` |

Expand Down
15 changes: 8 additions & 7 deletions examples/states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ const EXPECTED_PIPELINES: usize = 8;
// The value will likely differ on the web due to different implementations of some
// render features.
#[cfg(target_arch = "wasm32")]
const EXPECTED_PIPELINES: usize = 5;
const EXPECTED_PIPELINES: usize = 6;

fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(PipelinesReadyPlugin)
.add_state::<GameState>()
.init_state::<GameState>()
.add_systems(Startup, setup_loading_screen)
.add_systems(
Update,
transition
.run_if(in_state(GameState::Loading))
.run_if(resource_changed::<PipelinesReady>()),
.run_if(resource_changed::<PipelinesReady>),
)
.add_systems(OnExit(GameState::Loading), cleanup::<LoadingOnly>)
.run();
Expand All @@ -51,21 +51,22 @@ fn setup_loading_screen(
commands.spawn(PointLightBundle {
point_light: PointLight {
shadows_enabled: true,
intensity: 48_000.,
..default()
},
transform: Transform::from_xyz(3.0, 6.0, 5.0),
..default()
});

commands.spawn(PbrBundle {
mesh: meshes.add(shape::Cylinder::default().into()),
material: materials.add(Color::PINK.into()),
mesh: meshes.add(Cylinder::default()),
material: materials.add(Color::PINK),
..default()
});

commands.spawn(PbrBundle {
mesh: meshes.add(shape::Plane::from_size(10.0).into()),
material: materials.add(Color::rgb(0.4, 0.4, 0.4).into()),
mesh: meshes.add(Plane3d::default().mesh().size(10.0, 10.0)),
material: materials.add(Color::rgb(0.4, 0.4, 0.4)),
transform: Transform::from_xyz(0., -0.5, 0.),
..default()
});
Expand Down

0 comments on commit 46b9d40

Please sign in to comment.