ThorVG Example

May 20, 2026 ยท View on GitHub

CodeFactor License Discord OpenCollective Build

ThorVG Example

ThorVG Example provides a wide range of example codes. Those examples demonstrate how to use ThorVG's APIs to render vector graphics, handle images, and play animations. Each example is designed to highlight specific features and help developers get started quickly with ThorVG.

How To

This section details the steps required to configure the environment for installing ThorVG Example. Please note that ThorVG and SDL must be installed on your system before building the examples.

Build

ThorVG Example supports Meson build system. Install meson and ninja if you don't have them already.

Run Meson to configure ThorVG Example in the project root folder.

meson setup builddir

Run ninja to build

ninja -C builddir

Run

Once the build is complete, you can run each example binary directly from the builddir folder.

To run an example with the GL or WGPU engine, pass 'gl' or 'wg' as a command-line argument. By default, the examples run with the software rendering engine.

./builddir/src/Shapes gl    # Runs with OpenGL/ES
./builddir/src/Shapes wg    # Runs with WebGPU
./builddir/src/Shapes       # Runs with Software (default)
image