TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 230 subscribers
Post #25359 24
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
GitHub GitHub - micro-gl/micro-gl: Headers Only C++11 CPU Vector Graphics. no std-lib, no FPU and no GPU required ! Headers Only C++11 CPU Vector Graphics. no std-lib, no FPU and no GPU required ! - micro-gl/micro-gl
More from @r_cpp
  1. Sep 29, 2026Boost.Graph 1.95 will be C++17 Dear Boost.Graph community, In two release cycles (Boost re…
  2. Sep 26, 2026Token Sequence Injection & Modern Macros: The Most Game-Changing Compile-Time Feature in C…
  3. Sep 25, 2026myStringStream.str("") Considered Harmful Under C++20 I was recently looking at some (rath…
  4. Sep 20, 2026A clever branch free optimization I'm the developer of memlz which is an extremely fast co…
  5. Sep 15, 2026Inside Boost.PolyCollection https://bannalia.blogspot.com/2026/09/inside-boostpolycollecti…
  6. Sep 11, 2026C++26: Standard Library Hardening Experiments https://www.cppstories.com/2026/hardening-ex…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →