Skip to content

Commit d0f11e9

Browse files
Continue integration
1 parent 14fe902 commit d0f11e9

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-3
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ eframe = { version = "0.31", default-features = false, features = [
1313
] }
1414
wgpu = "24"
1515
egui-wgpu = "0.31"
16-
log = "0.4"
16+
log = { version = "0.4", optional = true }
1717
glam = { version = "0.30", features = ["fast-math"] }
1818
bytemuck = "1.22"
1919
rand = { version = "0.9", default-features = false, features = ["small_rng"] }
@@ -27,10 +27,11 @@ mimalloc = { version = "0.1" }
2727
[target.'cfg(target_arch = "wasm32")'.dependencies]
2828
wgpu = { version = "24", features = ["webgl"] }
2929
wasm-bindgen-futures = "0.4"
30+
web-time = "1.1" # TODO: See if I can get rid of this
3031
web-sys = "0.3" # to access the DOM (to hide the loading text)
3132

3233
[features]
33-
logs = ["dep:env_logger"]
34+
logs = ["dep:env_logger", "dep:log"]
3435

3536
[profile.release]
3637
codegen-units = 1 # Allows LLVM to perform better optimization.

src/app.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ use crate::simulation::{ParticleSimulation, SimParams, SimulationMethod};
1010
use egui::epaint::text::{FontInsert, InsertFontFamily};
1111
use glam::Vec3;
1212
use std::collections::HashSet;
13+
#[cfg(not(target_arch = "wasm32"))]
1314
use std::time::Instant;
15+
#[cfg(target_arch = "wasm32")]
16+
use web_time::Instant;
1417

1518
pub struct ParticleApp {
1619
simulation: Box<dyn ParticleSimulation>,

src/custom_renderer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ impl CallbackTrait for ClonedParticleCallback {
2929
render_pass.set_pipeline(&self.render_pipeline);
3030
render_pass.set_bind_group(0, &self.camera_bind_group, &[]);
3131
render_pass.set_vertex_buffer(0, self.particle_buffer.slice(..));
32+
// TODO: See this
3233
render_pass.draw(0..1, 0..self.num_particles);
3334
}
3435
}

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn main() -> eframe::Result {
6262
}),
6363

6464
on_surface_error: Arc::new(|error| {
65-
log::error!("Surface error: {:?}", error);
65+
eprintln!("Surface error: {:?}", error);
6666
egui_wgpu::SurfaceErrorAction::RecreateSurface
6767
}),
6868
},

0 commit comments

Comments
 (0)