pixels/examples/minimal-web
Jay Oster 899e27bafa
Remove get_ and set_ prefixes from public APIs (#341)
This renames:

- `get_frame` to `frame`
- `get_frame_mut` to `frame_mut`
- `set_clear_color` to `clear_color`

Which more closely follows convention set by the standard library et al.
2023-03-09 19:42:57 -08:00
..
src Remove get_ and set_ prefixes from public APIs (#341) 2023-03-09 19:42:57 -08:00
Cargo.toml Update all dependencies in the workspace (#323) 2022-12-17 17:35:02 -08:00
README.md Update cargo-run-wasm (#329) 2023-01-07 15:18:09 -08:00

Hello Pixels + Web

Hello Pixels + Web

Minimal example for WebGL2.

Install build dependencies

Install the WASM32 target:

rustup target add wasm32-unknown-unknown

Running on the Web

Build the project and start a local server to host it:

cargo run-wasm --release --package minimal-web

Open http://localhost:8000/ in your browser to run the example.

To build the project without serving it:

cargo run-wasm --release --build-only --package minimal-web

The build files are stored in ./target/wasm-examples/minimal-web/.

Running on native targets

cargo run --release --package minimal-web

About

This example is based on minimal-winit, demonstrating how to build your app for WebGL2 targets.