Skip to content

Commit

Permalink
Upgrade to Bevy 0.12 (djeedai#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
djeedai authored Nov 5, 2023
1 parent fe54067 commit c12274a
Show file tree
Hide file tree
Showing 30 changed files with 456 additions and 386 deletions.
18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_hanabi"
version = "0.8.0-dev"
version = "0.8.0"
authors = ["Jerome Humbert <[email protected]>"]
edition = "2021"
description = "Hanabi GPU particle system for the Bevy game engine"
Expand Down Expand Up @@ -28,7 +28,7 @@ default = ["2d", "3d", "gpu_tests"]
gpu_tests = []

[dependencies]
bytemuck = { version = "1.7.2", features = ["derive"] }
bytemuck = { version = "1", features = ["derive"] }
copyless = "0.1"
rand = "0.8"
rand_pcg = "0.3"
Expand All @@ -37,27 +37,27 @@ anyhow = "1.0"
ron = "0.8"
bitflags = "2.3"
typetag = "0.2"
thiserror = "1.0"

[dependencies.bevy]
version = "0.11"
version = "0.12"
default-features = false
features = [ "bevy_core_pipeline", "bevy_render", "bevy_asset", "x11" ]

[package.metadata.docs.rs]
all-features = true

[dev-dependencies]
# Same version as Bevy 0.11 (bevy_render)
wgpu = "0.16"
# For shader snippet validation
naga = "0.12"
naga_oil = "0.8"
# Same versions as Bevy 0.12 (bevy_render)
wgpu = "0.17.1"
naga = "0.13"
naga_oil = "0.10"

# For procedural texture generation in examples
noise = "0.8"

futures = "0.3"
bevy-inspector-egui = "0.19"
#bevy-inspector-egui = "0.19"

[[example]]
name = "firework"
Expand Down
8 changes: 5 additions & 3 deletions examples/2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use bevy::{
},
sprite::{MaterialMesh2dBundle, Mesh2dHandle},
};
use bevy_inspector_egui::quick::WorldInspectorPlugin;
// use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

Expand All @@ -30,7 +30,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
level: bevy::log::Level::WARN,
filter: "bevy_hanabi=warn,2d=trace".to_string(),
})
.set(RenderPlugin { wgpu_settings })
.set(RenderPlugin {
render_creation: wgpu_settings.into(),
})
.set(WindowPlugin {
primary_window: Some(Window {
title: "🎆 Hanabi — 2d".to_string(),
Expand All @@ -40,7 +42,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}),
)
.add_plugins(HanabiPlugin)
.add_plugins(WorldInspectorPlugin::default())
//.add_plugins(WorldInspectorPlugin::default())
.add_systems(Startup, setup)
.add_systems(Update, (bevy::window::close_on_esc, update_plane))
.run();
Expand Down
8 changes: 5 additions & 3 deletions examples/activate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use bevy::{
RenderPlugin,
},
};
use bevy_inspector_egui::quick::WorldInspectorPlugin;
// use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

Expand All @@ -35,7 +35,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
level: bevy::log::Level::WARN,
filter: "bevy_hanabi=warn,activate=trace".to_string(),
})
.set(RenderPlugin { wgpu_settings })
.set(RenderPlugin {
render_creation: wgpu_settings.into(),
})
.set(WindowPlugin {
primary_window: Some(Window {
title: "🎆 Hanabi — activate".to_string(),
Expand All @@ -45,7 +47,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}),
)
.add_plugins(HanabiPlugin)
.add_plugins(WorldInspectorPlugin::default())
//.add_plugins(WorldInspectorPlugin::default())
.add_systems(Startup, setup)
.add_systems(Update, (bevy::window::close_on_esc, update))
.run();
Expand Down
8 changes: 5 additions & 3 deletions examples/billboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use bevy::{
camera::Projection, render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin,
},
};
use bevy_inspector_egui::quick::WorldInspectorPlugin;
// use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

Expand All @@ -32,7 +32,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
level: bevy::log::Level::WARN,
filter: "bevy_hanabi=warn,billboard=trace".to_string(),
})
.set(RenderPlugin { wgpu_settings })
.set(RenderPlugin {
render_creation: wgpu_settings.into(),
})
.set(WindowPlugin {
primary_window: Some(Window {
title: "🎆 Hanabi — billboard".to_string(),
Expand All @@ -42,7 +44,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}),
)
.add_plugins(HanabiPlugin)
.add_plugins(WorldInspectorPlugin::default())
//.add_plugins(WorldInspectorPlugin::default())
.add_systems(Startup, setup)
.add_systems(Update, (bevy::window::close_on_esc, rotate_camera))
.run();
Expand Down
8 changes: 5 additions & 3 deletions examples/circle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use bevy::{
prelude::*,
render::{render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin},
};
use bevy_inspector_egui::quick::WorldInspectorPlugin;
// use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

Expand All @@ -31,7 +31,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
level: bevy::log::Level::WARN,
filter: "bevy_hanabi=warn,circle=trace".to_string(),
})
.set(RenderPlugin { wgpu_settings })
.set(RenderPlugin {
render_creation: wgpu_settings.into(),
})
.set(WindowPlugin {
primary_window: Some(Window {
title: "🎆 Hanabi — circle".to_string(),
Expand All @@ -42,7 +44,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
)
.add_systems(Update, bevy::window::close_on_esc)
.add_plugins(HanabiPlugin)
.add_plugins(WorldInspectorPlugin::default())
//.add_plugins(WorldInspectorPlugin::default())
.add_systems(Startup, setup)
.run();

Expand Down
4 changes: 2 additions & 2 deletions examples/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use bevy::{
log::LogPlugin,
prelude::*,
};
use bevy_inspector_egui::quick::WorldInspectorPlugin;
// use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

Expand All @@ -36,7 +36,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
)
.add_systems(Update, bevy::window::close_on_esc)
.add_plugins(HanabiPlugin)
.add_plugins(WorldInspectorPlugin::default())
//.add_plugins(WorldInspectorPlugin::default())
.add_systems(Startup, setup)
.run();

Expand Down
4 changes: 2 additions & 2 deletions examples/firework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use bevy::{
log::LogPlugin,
prelude::*,
};
use bevy_inspector_egui::quick::WorldInspectorPlugin;
// use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

Expand All @@ -43,7 +43,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
)
.add_systems(Update, bevy::window::close_on_esc)
.add_plugins(HanabiPlugin)
.add_plugins(WorldInspectorPlugin::default())
//.add_plugins(WorldInspectorPlugin::default())
.add_systems(Startup, setup)
.run();

Expand Down
8 changes: 5 additions & 3 deletions examples/force_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use bevy::{
camera::Projection, render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin,
},
};
use bevy_inspector_egui::quick::WorldInspectorPlugin;
// use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

Expand All @@ -45,7 +45,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
level: bevy::log::Level::WARN,
filter: "bevy_hanabi=warn,force_field=trace".to_string(),
})
.set(RenderPlugin { wgpu_settings })
.set(RenderPlugin {
render_creation: wgpu_settings.into(),
})
.set(WindowPlugin {
primary_window: Some(Window {
title: "🎆 Hanabi — force field".to_string(),
Expand All @@ -57,7 +59,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
//.add_plugins(LookTransformPlugin)
//.add_plugins(OrbitCameraPlugin::default())
.add_plugins(HanabiPlugin)
.add_plugins(WorldInspectorPlugin::default())
//.add_plugins(WorldInspectorPlugin::default())
.add_systems(Startup, setup)
.add_systems(Update, (bevy::window::close_on_esc, update))
.run();
Expand Down
8 changes: 5 additions & 3 deletions examples/gradient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use bevy::{
view::RenderLayers, RenderPlugin,
},
};
use bevy_inspector_egui::quick::WorldInspectorPlugin;
// use bevy_inspector_egui::quick::WorldInspectorPlugin;
use std::f32::consts::PI;

use bevy_hanabi::prelude::*;
Expand All @@ -26,7 +26,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
level: bevy::log::Level::WARN,
filter: "bevy_hanabi=warn,gradient=trace".to_string(),
})
.set(RenderPlugin { wgpu_settings })
.set(RenderPlugin {
render_creation: wgpu_settings.into(),
})
.set(WindowPlugin {
primary_window: Some(Window {
title: "🎆 Hanabi — gradient".to_string(),
Expand All @@ -36,7 +38,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}),
)
.add_plugins(HanabiPlugin)
.add_plugins(WorldInspectorPlugin::default())
//.add_plugins(WorldInspectorPlugin::default())
.add_systems(Startup, setup)
.add_systems(Update, (bevy::window::close_on_esc, update))
.run();
Expand Down
8 changes: 5 additions & 3 deletions examples/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use bevy::{
mesh::shape::Cube, render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin,
},
};
use bevy_inspector_egui::quick::WorldInspectorPlugin;
// use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

Expand All @@ -36,7 +36,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
level: bevy::log::Level::WARN,
filter: "bevy_hanabi=warn,init=trace".to_string(),
})
.set(RenderPlugin { wgpu_settings })
.set(RenderPlugin {
render_creation: wgpu_settings.into(),
})
.set(WindowPlugin {
primary_window: Some(Window {
title: "🎆 Hanabi — init".to_string(),
Expand All @@ -46,7 +48,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}),
)
.add_plugins(HanabiPlugin)
.add_plugins(WorldInspectorPlugin::default())
//.add_plugins(WorldInspectorPlugin::default())
.add_systems(Startup, setup)
.add_systems(Update, (bevy::window::close_on_esc, rotate_effect))
.run();
Expand Down
4 changes: 2 additions & 2 deletions examples/instancing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use bevy::{
core_pipeline::tonemapping::Tonemapping, log::LogPlugin, prelude::*, render::mesh::shape::Cube,
};
use bevy_inspector_egui::quick::WorldInspectorPlugin;
// use bevy_inspector_egui::quick::WorldInspectorPlugin;
use rand::Rng;

use bevy_hanabi::prelude::*;
Expand Down Expand Up @@ -186,7 +186,7 @@ fn main() {
}),
)
.add_plugins(HanabiPlugin)
.add_plugins(WorldInspectorPlugin::default())
//.add_plugins(WorldInspectorPlugin::default())
.insert_resource(InstanceManager::new(5, 4))
.add_systems(Startup, setup)
.add_systems(Update, (bevy::window::close_on_esc, keyboard_input_system))
Expand Down
8 changes: 5 additions & 3 deletions examples/lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use bevy::{
mesh::shape::Cube, render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin,
},
};
use bevy_inspector_egui::quick::WorldInspectorPlugin;
// use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

Expand All @@ -37,7 +37,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
level: bevy::log::Level::WARN,
filter: "bevy_hanabi=warn,lifetime=trace".to_string(),
})
.set(RenderPlugin { wgpu_settings })
.set(RenderPlugin {
render_creation: wgpu_settings.into(),
})
.set(WindowPlugin {
primary_window: Some(Window {
title: "🎆 Hanabi — lifetime".to_string(),
Expand All @@ -48,7 +50,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
)
.add_systems(Update, bevy::window::close_on_esc)
.add_plugins(HanabiPlugin)
.add_plugins(WorldInspectorPlugin::default())
//.add_plugins(WorldInspectorPlugin::default())
.add_systems(Startup, setup)
.run();

Expand Down
6 changes: 3 additions & 3 deletions examples/multicam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use bevy::{
},
window::WindowResized,
};
use bevy_inspector_egui::quick::WorldInspectorPlugin;
// use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

Expand All @@ -31,7 +31,7 @@ fn main() {
}),
)
.add_plugins(HanabiPlugin)
.add_plugins(WorldInspectorPlugin::default())
//.add_plugins(WorldInspectorPlugin::default())
.add_systems(Startup, setup)
.add_systems(
Update,
Expand Down Expand Up @@ -264,7 +264,7 @@ fn update_camera_viewports(
// changes so then each camera always takes up half the screen.
// A resize_event is sent when the window is first created, allowing us to reuse
// this system for initial setup.
for resize_event in resize_events.iter() {
for resize_event in resize_events.read() {
let Ok(window) = window.get(resize_event.window) else {
continue;
};
Expand Down
4 changes: 2 additions & 2 deletions examples/portal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use bevy::{
log::LogPlugin,
prelude::*,
};
use bevy_inspector_egui::quick::WorldInspectorPlugin;
// use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

Expand All @@ -40,7 +40,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
)
.add_systems(Update, bevy::window::close_on_esc)
.add_plugins(HanabiPlugin)
.add_plugins(WorldInspectorPlugin::default())
//.add_plugins(WorldInspectorPlugin::default())
.add_systems(Startup, setup)
.run();

Expand Down
Loading

0 comments on commit c12274a

Please sign in to comment.