I spent 6 months building a zero-std, header-only graphics ecosystem from scratch—including my own container library
Hi everyone,
I wanted to share a massive passion project I've been refining: **micro-gl** (and its sister libraries). I needed a lightweight vector graphics engine for constrained environments, but I wanted absolute control over memory and types. I ended up falling down a 6-month rabbit hole.
**The Core Architecture:**
* **Zero Standard Library (**`std::`**):** No hidden allocations. To support this, I spent an intense 3 weeks writing my own standalone container library (**micro-containers**) featuring AVL trees, an array-backed LRU pool, and a linear-probing hash map sized entirely at compile time via templates.
* **Type-Agnostic Math:** The entire rasterizer is templated. It can run on raw `float`, `double`, or custom fixed-point integer types (like `Q` formats) for microcontrollers without an FPU.
* **The Engine Stack:**
* `micro-gl`: CPU-bound rasterizer handling textures, gradients, and Porter-Duff blending.
* `micro-tess`: A precision-agnostic polygon tessellator.
* `nitro-gl`: An OpenGL implementation that compiles C++ shader object hierarchies into monolithic GLSL strings at runtime, cached via MurmurHash.
Everything is purely header-only, allocator-aware, and optimized for extreme cache locality.
Repositories are open-source here:
* Graphics Engine (CPU): [https://github.com/micro-gl/micro-gl](https://github.com/micro-gl/micro-gl)
* Graphics Engine (GPU): [https://github.com/micro-gl/nitro-gl](https://github.com/micro-gl/nitro-gl)
* Custom Containers: [https://github.com/micro-gl/micro-containers](https://github.com/micro-gl/micro-containers)
I would love to hear your thoughts on the template design and compile-time sizing strategies!
https://redd.it/1tvh00b
@r_cpp
Post #25359
24