Sokol Triangle
The strongest FFI proof target in the repo: generated Sokol bindings, manifest-driven static linking, and a real triangle app.
The Sokol triangle example is the main proof target for the first FFI version.
It proves all of these together:
- manifest-driven native library description
- Clang-driven autobinding generation
- generated Kira bindings emitted as a normal module
- static library build rules per host
- direct use of generated declarations from hand-written Kira code
- native callbacks from Sokol into Kira
@Nativefunctions
Check The Binding Setup
Start with:
kira check examples/sokol_triangleThat validates the import/manifests/autobinding path before launching the app.
Run The Native Proof
kira run --backend llvm examples/sokol_triangleThis example opens a window, initializes Sokol, draws a triangle, and shuts down through Kira-written native code using the generated bindings directly.
Files That Matter
examples/sokol_triangle/native_libs/sokol.tomlexamples/sokol_triangle/sokol.kiraexamples/sokol_triangle/app/main.kira
There is also examples/sokol_runtime_entry/app/main.kira, which uses the same general binding flow with slightly different state handling.
Non-GUI Companion Proof
If you want a no-window proof that still exercises Sokol FFI, the corpus includes:
zig build run -- run --backend hybrid tests/pass/run/ffi_sokol_hybridCurrent output:
sokol ffiThat is useful when you want to confirm the binding path without launching the full triangle app.