Expand description
Example custom Mouser engine, “flat”.
It rasterises the frame on the CPU and presents it with softbuffer, which
keeps the example small while exercising the whole ABI: rects, glyph
coverage, images, resize and redraw. Build with
cargo build -p mouser-engine-example --release and install with
mouser engine install crates/mouser-engine-example after copying the
library next to engine.toml (see docs/engines.md).
Test hooks: MOUSER_FLAT_FAIL=create makes create fail,
MOUSER_FLAT_FAIL=draw makes draw return an error, and
MOUSER_FLAT_ABI=<n> reports another ABI version, and
MOUSER_FLAT_CRASH_AT=<n> aborts the process in the n-th draw (to test
crash isolation). Supports window surfaces (Wayland, Xlib) and
SURFACE_PIXELS (Mouser’s engine host).
Functions§
- mouser_
engine_ v1 - The v1 entry point, for Mouser builds older than 1.4.0.
- mouser_
engine_ v2 - The v2 entry point (tried first). Test hooks:
MOUSER_FLAT_ABIorMOUSER_FLAT_V1_ONLYmake it return null, so Mouser falls back to v1. - rasterize
- The frame rasteriser (shared with tests).