NanoVG is a small OpenGL-backed vector drawing library with a canvas-like API for UI rendering and visualizations.
Overview
NanoVG renders antialiased 2D paths on OpenGL with an API modeled after HTML5 canvas calls. Backends cover OpenGL 2.0, OpenGL ES 2 and 3, and OpenGL 3.2 core through nanovg_gl.h. This project is not actively maintained.
Drawing follows begin path, shape definition, fill or stroke steps, with even-odd rules for holes via winding hints. Render targets require a stencil buffer; frames must sit between nvgBeginFrame and nvgEndFrame.
Upstream maintenance is not active. Font and image handling lean on stb_truetype and stb_image. Licensing uses zlib.
Ports and downstream UI toolkits are listed in community documentation.
Key features
- Canvas-style vector API
- OpenGL rendering backends
- Antialiased stroke and fill
- Stencil-based rendering
- stb_truetype font rendering
- stb_image texture loading
- Composite path hole support
- Debug validation flag
Use cases
- Custom OpenGL user interfaces
- Embedded data visualizations
- Game and tool overlay drawing
- Lightweight interface rendering