diff --git a/examples/hello/README.md b/examples/hello/README.md index 5e0b889..ed86728 100644 --- a/examples/hello/README.md +++ b/examples/hello/README.md @@ -21,9 +21,9 @@ cargo run --features=window-sdl2 To run with web-sys: ```shell -cargo +nightly build --target wasm32-unknown-unknown +cargo build --target wasm32-unknown-unknown mkdir -p generated -wasm-bindgen ../../target/wasm32-unknown-unknown/debug/hello.wasm --out-dir generated --no-modules +wasm-bindgen ../../target/wasm32-unknown-unknown/debug/hello.wasm --out-dir generated --target web cp index.html generated ``` diff --git a/examples/hello/index.html b/examples/hello/index.html index 4e1f773..b8671f0 100644 --- a/examples/hello/index.html +++ b/examples/hello/index.html @@ -5,10 +5,10 @@ - diff --git a/examples/hello/src/main.rs b/examples/hello/src/main.rs index 8a34e8f..160c5af 100644 --- a/examples/hello/src/main.rs +++ b/examples/hello/src/main.rs @@ -1,22 +1,15 @@ use glow::*; -#[cfg(all(target_arch = "wasm32", feature = "web-sys"))] -use wasm_bindgen::prelude::*; - #[cfg(all(target_arch = "wasm32", feature = "stdweb"))] use std_web::{ traits::*, unstable::TryInto, web::{document, html_element::*}, }; + #[cfg(all(target_arch = "wasm32", feature = "stdweb"))] use webgl_stdweb::WebGL2RenderingContext; -#[cfg_attr(all(target_arch = "wasm32", feature = "web-sys"), wasm_bindgen(start))] -pub fn wasm_main() { - main(); -} - fn main() { unsafe { // Create a context from a WebGL2 context on wasm32 targets