A focused 2D layer over OpenGL
VectorGL turns common vector operations—paths, shapes, text, images, clipping, and effects—into GPU-backed draw calls. Its public API stays small enough to learn quickly while still supporting structured scenes and animation.
Choose the API per surface.Canvas and Scene share the same renderer, so an application can use both without maintaining separate graphics stacks.
Three layers with clear responsibilities
Your applicationCanvas or SceneDrawing intent and interaction
→
VectorGLRendererBatches, paths, text, effects
→
GPUOpenGL 3.3Portable hardware rendering
Immediate when you want control, retained when you want structure
Canvas API
Draw every frame
Best for charts, editors, custom widgets, and highly dynamic visuals. Your code owns ordering and redraw logic.
Canvas guide →Scene API
Compose persistent nodes
Best for interface trees and animated objects. VectorGL manages traversal, transforms, hit testing, and transitions.
Scene guide →A predictable render loop
- Process inputUpdate interaction state and scene properties.
- Advance animationTick the animator using frame delta time.
- Submit drawingIssue Canvas operations or render the Scene tree.
- PresentSwap the host window's OpenGL buffers.
Build and run your first frame
VectorGL uses CMake and requires a C++20 compiler. Clone the repository to build the included examples, or consume it with FetchContent.
Terminal
git clone https://github.com/mahtab04/vectorgl.git
cd vectorgl
cmake -S . -B build -DVECTORGL_BUILD_EXAMPLES=ON
cmake --build build --config Release