flecs-rs: Rust bindings for Flecs
A Rust binding for the Flecs ECS library: https://github.com/SanderMertens/flecs
Wraps native Flecs v3.2.8
A Simple Example
use *;
Compiling and running the examples
Main examples are located in the examples directory. These can be run like so:
Compiling with WebAssembly
Compiling with WebAssembly requires using the wasm32-unknown-emscripten target.
This is because there is no official toolchain for C/C++ targeting wasm32-unknown-unknown, which means that C/C++ bindings with do not work with this target and will result in unresolved symbols.
The Emscripten target which is not as well supported as the wasm32-unknown-unknown, which means that wasm-bindgen and some other popular Rust libraries that target WebAssembly will not work. So be sure to keep that in mind.
Create a directory to be statically served:
Create a file called index.html under static/:
Emscripten Setup: A specific version of the Emscripten SDK is required. Newer versions will usually cause build or runtime errors.
On Mac you may need to make sure your Python3 SSL certs are setup: https://bugs.python.org/issue43404
make setup_emsdk EMSDK=/your/install/directory
If necessary, you can override the standard library path:
By default it uses the EMSDK's sysroot for includes.
On some platforms you may get linker errors:
To avoid this run this prior to building: (TODO make this automatic)
Build WASM binary:
Serve static file locally with any HTTP server tool, for example basic-http-server: