Skip to main content

gasm_host/
lib.rs

1//! Native host for [gasm](https://gasm.emdzej.pl) games.
2//!
3//! Load a guest `.wasm` with [`host::Game::load`], drive it with
4//! [`host::Game::frame`] at the guest's frame rate, and plug in the pieces you
5//! need: [`assets::Assets`] (memory, file-backed, folders), [`gfx::Gfx`] (wgpu:
6//! window, offscreen or null), [`audio::AudioOut`], [`net::Net`] (WebSocket,
7//! `ws://`/`wss://`), [`storage::Storage`] (per-game key/value).
8//!
9//! Complete runners built from these parts: [`headless::run`] (reproducible
10//! runs with hashes) and, with the `window` feature (default), `window::run`
11//! (winit window, cpal audio, gilrs gamepads, keyboard layouts). The `gasm-run`
12//! binary is their command line.
13//!
14//! ABI: <https://gasm.emdzej.pl/docs/abi> (machine-readable: `spec/abi.json`).
15
16pub mod assets;
17pub mod audio;
18pub mod gfx;
19pub mod gl;
20pub mod headless;
21pub mod host;
22pub mod keys;
23pub mod net;
24pub mod present;
25pub mod script;
26pub mod session;
27pub mod storage;
28pub mod switching;
29pub mod wasi;
30
31#[cfg(feature = "window")]
32pub mod keymap;
33#[cfg(feature = "window")]
34pub mod window;