Skip to main content

Crate gasm_host

Crate gasm_host 

Source
Expand description

Native host for gasm games.

Load a guest .wasm with host::Game::load, drive it with host::Game::frame at the guest’s frame rate, and plug in the pieces you need: gfx::Gfx (wgpu: window, offscreen or null), audio::AudioSink (cpal), net::Net (WebSocket, ws:///wss://), storage::Storage (per-game key/value). The gasm-run binary in this crate is a complete runner built from these parts; gasm-relay is the room relay.

ABI: https://gasm.emdzej.pl/docs/abi (machine-readable: spec/abi.json).

Modules§

audio
Audio output: guest samples -> linear resampler -> ring buffer -> cpal device.
gfx
gasm:gfx on wgpu, plus the 2D video_present blit.
host
The gasm ABI v0 host: instantiates a guest and implements the “gasm”, “gasm:gfx” and “gasm:net” imports.
net
gasm:net for the native runner: WebSocket client connections.
storage
gasm:storage for the native runner: one directory per game, one file per key.