summaryrefslogtreecommitdiff
path: root/src/context.rs
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2025-02-16 17:04:13 -0500
committerLLLL Colonq <llll@colonq>2025-02-16 17:04:13 -0500
commitf7062b9a2cae6db9345d9f9d7ceebf5b441ddd3a (patch)
treebed9acea1f8760375544b0837af70a3140878245 /src/context.rs
parent4603528c337edfa7821dbb31ade4d8dd63f9efb4 (diff)
Fix helpers.js handling
Diffstat (limited to 'src/context.rs')
-rw-r--r--src/context.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/context.rs b/src/context.rs
index 05d6990..502bbdb 100644
--- a/src/context.rs
+++ b/src/context.rs
@@ -1,10 +1,13 @@
use glow::HasContext;
#[cfg(target_arch = "wasm32")]
+use wasm_bindgen::prelude::*;
+
+#[cfg(target_arch = "wasm32")]
use winit::platform::web::WindowExtWebSys;
#[cfg(target_arch = "wasm32")]
-#[link(wasm_import_module = "./helpers.js")]
+#[wasm_bindgen(module = "/src/helpers.js")]
extern {
fn js_track_resized_setup();
fn js_poll_resized() -> bool;
@@ -69,7 +72,7 @@ impl Context {
};
#[cfg(target_arch = "wasm32")]
- unsafe { js_track_resized_setup(); }
+ js_track_resized_setup();
let ret = Self {
render_width, render_height,
@@ -126,9 +129,7 @@ impl Context {
#[cfg(target_arch = "wasm32")]
pub fn resize_necessary(&self) -> bool {
- unsafe {
- js_poll_resized()
- }
+ js_poll_resized()
}
#[cfg(not(target_arch = "wasm32"))]