Skip to main content

Crate mouser_engine_flat

Crate mouser_engine_flat 

Source
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_ABI or MOUSER_FLAT_V1_ONLY make it return null, so Mouser falls back to v1.
rasterize
The frame rasteriser (shared with tests).