Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
EriKWDev committed Dec 7, 2024
1 parent 202a229 commit e2695ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ profiling = "1"
slab = "0.4"
strum = { version = "0.25", features = ["derive"] }
web-sys = "0.3.60"
winit = { version = "0.30" }
# winit = { version = "0.30", default-features=false, features=["x11", "rwh_06"] }
# winit = { version = "0.30" }
winit = { version = "0.30", default-features=false, features=["x11", "rwh_06"] }

[lib]

Expand Down Expand Up @@ -91,7 +91,7 @@ del-geo = "=0.1.29"

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
# see https://github.com/emilk/egui/issues/4270
egui-winit = "0.29"
egui-winit = { version="0.29", default-features=false, features=["links"] }

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
# see https://github.com/emilk/egui/issues/4270
Expand Down
7 changes: 6 additions & 1 deletion examples/particle/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ impl Example {
}

fn add_gui(&mut self, ui: &mut egui::Ui) {
ui.add_space(5.0);
ui.heading("Particle System");
self.particle_system.add_gui(ui);

Expand All @@ -260,6 +259,7 @@ impl Example {
self.context.wait_for(&sp, !0);
}

let old_params = self.particle_system.params;
self.particle_system.destroy(&self.context);
self.particle_system = particle::System::new(
&self.context,
Expand All @@ -270,6 +270,8 @@ impl Example {
},
self.sample_count,
);
self.particle_system.params = old_params;

if let Some(msaa_view) = self.msaa_view.take() {
self.context.destroy_texture_view(msaa_view);
}
Expand Down Expand Up @@ -351,7 +353,10 @@ fn main() {
let raw_input = egui_winit.take_egui_input(&window);
let egui_output = egui_winit.egui_ctx().run(raw_input, |egui_ctx| {
egui::SidePanel::left("info").show(egui_ctx, |ui| {
ui.add_space(5.0);
example.add_gui(ui);

ui.add_space(5.0);
if ui.button("Quit").clicked() {
target.exit();
}
Expand Down

0 comments on commit e2695ce

Please sign in to comment.