A C/C++ render engine designed to sit at the surface of a polyglot simulation stack.
c-brain accepts primitives over TCP, UDP, and HTTP — validates their structure, accumulates them into timed windows, and hands them to a C++ render client that generates geometry on the fly using a Lagrangian primitive system built on sokol.
It is the render surface of Locus Stratum Infinitum.
- Opens three network lanes on startup: TCP for commands, UDP for effects, HTTP for control
- Validates incoming packets by structure — never by semantics
- Accumulates little-t ticks into Big-T windows via an internal enumerator
- Passes live primitives to a registered C++ render callback each frame
- Ships a C++ client reference implementation with a Lagrangian shape generator and tetrahedron world geometry
- Interpret simulation data — that belongs to the simulation language
- Hold world state — that belongs to Invoke
- Manage clients — Invoke handles who sees what
Invoke (world state) → TCP/UDP → web.c → registry → sokol_tick → C++ client → GPU
The C++ client is the only part that touches the GPU. Everything in C is transport and timing.
Primitives are terminated by bit contract. A float field of 0x00000000 is an explicit termination signal. Additionally, the biased IEEE 754 exponent is checked — values outside the configured safe window (underflow or explosion) self-terminate without requiring an explicit signal from the simulation.
The render callback is an open registration point. Swap client_on_renderable for your own function via sokol_on_renderable() and bring your own shader and pipeline. c-brain does not enforce a visual style.
Requires CMake 4.3+, a C23/C++20 compiler, and OpenGL (SOKOL_GLCORE).
cmake -B build
cmake --build build