.riv file on screen with a real GPU backend.
Prerequisites
- A recent clang or MSVC that supports C++17.
- git — the build script will clone and bootstrap
premake5itself. - Platform SDK for your renderer of choice (Windows SDK for D3D, Xcode for Metal, Vulkan SDK for Vulkan, etc).
Rive uses clang vector
builtins. When building with clang, use the
latest version available — older toolchains may fail to compile the renderer.
1. Clone and Build the Runtime
build/build_rive.sh (with a
PowerShell wrapper build_rive.ps1 for Windows). It installs the pinned
premake5 version on first run and dispatches to the right build system
for your platform (gmake2 on macOS/Linux, MSBuild on Windows, etc).
build_rive.sh(no args) — debug build for the host.build_rive.sh release clean— clean rebuild.build_rive.sh ninja release— use Ninja instead of make.build_rive.sh ios release/build_rive.sh android release— cross-compile.
out/release/ (or out/debug/). You’ll link
against librive.a (or rive.lib on Windows), plus the per-backend
renderer libraries like librive_pls_renderer.a.
2. Add Headers to Your Project
The public include roots are:3. Load a .riv File
4. Pick an Artboard and a State Machine
5. Advance and Draw
A render loop has three phases each frame: advance, draw, flush.6. Forward Input
Route pointer events back through the state machine so listeners and hit-testing work:What’s Next
Renderers
Wire up your platform’s GPU backend.
State Machines
Advance state machines, forward pointer events, and react to state changes.