diff --git a/Cargo.lock b/Cargo.lock index 9aa8e97..1c2eea4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2240,6 +2240,7 @@ dependencies = [ "strafesnet_deferred_loader", "strafesnet_rbx_loader", "strafesnet_snf", + "wasm-bindgen-futures", "wgpu", "winit", ] diff --git a/strafe-client/Cargo.toml b/strafe-client/Cargo.toml index 31f7123..ecacbaf 100644 --- a/strafe-client/Cargo.toml +++ b/strafe-client/Cargo.toml @@ -27,5 +27,6 @@ strafesnet_common = { path = "../lib/common", registry = "strafesnet" } strafesnet_deferred_loader = { path = "../lib/deferred_loader", features = ["legacy"], registry = "strafesnet", optional = true } strafesnet_rbx_loader = { path = "../lib/rbx_loader", registry = "strafesnet", optional = true } strafesnet_snf = { path = "../lib/snf", registry = "strafesnet", optional = true } +wasm-bindgen-futures = "0.4.49" wgpu = "23.0.1" winit = "0.30.7" diff --git a/strafe-client/src/main.rs b/strafe-client/src/main.rs index d3b1114..2cd8b67 100644 --- a/strafe-client/src/main.rs +++ b/strafe-client/src/main.rs @@ -14,5 +14,8 @@ mod graphics_worker; fn main(){ let title=format!("Strafe Client v{}",env!("CARGO_PKG_VERSION")); + #[cfg(target_arch="wasm32")] + wasm_bindgen_futures::spawn_local(setup::setup_and_start(title)); + #[cfg(not(target_arch="wasm32"))] pollster::block_on(setup::setup_and_start(title)); }