Skip to main content

Module ffi

Module ffi 

Source
Expand description

A C ABI over the deformations, so they can be called from outside Rust.

This exists for the preview: the engine is built for wasm32 and driven from the page, which means the mesh you watch bend in a browser is the one warp::mesh_part builds for a real window. A reimplementation in JavaScript would drift the first time either changed, and the drift would be invisible โ€“ the page would still bend something plausible.

A grid is written into a fixed scratch buffer rather than allocated, the same way solium_layout::ffi publishes its rectangles: the crate has no dependencies and wants none, and a wasm module that never allocates is a wasm module with nothing to leak.

Constantsยง

CAPACITY
The most points a grid will report, as x, y pairs.

Staticsยง

SCRATCH ๐Ÿ”’

Functionsยง

effect ๐Ÿ”’
The effect at index in Deform::all, with the parameters given.
publish ๐Ÿ”’
Put one point into the scratch buffer.
solium_axis_count
How many axes there are.
solium_effect_capacity
solium_effect_columns
How many columns the grid for this effect has. Points across is one more.
solium_effect_count
How many effects there are, so a caller can enumerate them.
solium_effect_grid
Deform a window into a target and write the whole grid out.
solium_effect_rows
How many rows the grid for this effect has. Points down is one more.
solium_effect_scratch
Where the last grid was written.