Update readme to reflect changes to wasm build
@@ -14,25 +14,30 @@ An OpenGL/WebGL renderer written in Rust for the fun of it.
- Effects which can be applied to a rendered image at some point in the rendering pipeline (e.g. Fog, Debug, ..)
- And more..
-### Run the 'hello world' example
+### Run the examples
- Desktop:
```console
+# Build and run an example, in this case 'hello_world':
$ cargo run --example hello_world --release
```
- Web:
```console
-# Any server that properly defines the `application/wasm` mime type can be used
-npm install -g http-server
+# Build and generate web output (webassembly, javascript and html files) into the pkg folder:
+wasm-pack build examples/hello_world --target web --out-name web --out-dir ../../pkg
-# Install the wasm-bindgen tool
-cargo install -f wasm-bindgen@0.2.40
+# Install a server that properly defines the `application/wasm` mime type for example
+npm install -g http-server
-# Build the 'hello world' example to WebAssembly
-cd examples/web/
-RELEASE=1 ./build
+# Start the server and go to http://localhost:8080 in a browser
+cd pkg/
+http-serve
+#
+```
-# Run the demo at http://localhost:8080
-cd www/
-http-server --open
+- Desktop + Web:
+```console
+# Build and run an example on desktop and also generate web output
+# (webassembly, javascript and html files) into the pkg folder:
+./examples/hello_world/run
```
\ No newline at end of file
