Skip to main content
The Rive C++ runtime (rive-cpp) is the lowest-level Rive runtime. It loads .riv files, advances state machines and animations, and draws into any Renderer — the Rive renderer (Metal, Vulkan, D3D11, D3D12, OpenGL/WebGL) or your own implementation. Higher level Rive runtimes (Apple, Android, Flutter, Unity, Unreal) wrap this library. Use the C++ runtime when you are:
  • Embedding Rive in a C++ application or game engine.
  • Targeting a platform that doesn’t have a Rive runtime yet.
  • Plugging Rive into your own renderer or render graph.

Getting Started

Build the runtime and put a .riv file on screen in under 100 lines of code.

Renderers

Set up the GPU backend for your platform — D3D11, D3D12, Metal, Vulkan, or GL.

File & Artboard

Import .riv files, query artboards, and create ArtboardInstances.

State Machines

Advance scenes, forward pointer events, and react to state changes.

Data Binding

Drive a Rive ViewModel from your application state.

Asset Loading

Resolve out-of-band images, fonts, and audio with FileAssetLoader.

Rendering Loop

beginFrame / flush — what runs each frame and what it costs.

External Renderer

Implement Renderer and Factory to use your own GPU backend.

Architecture at a Glance

Rive runtime rendering pipeline: your application owns a File (.riv data) and a RenderContext (D3D/Metal/Vulkan/...); File produces an ArtboardInstance, which produces a StateMachineInstance, which feeds the RiveRenderer along with the RenderContext to produce pixels. File / Artboard / StateMachineInstance know nothing about the GPU, and Renderer / RenderContext know nothing about Rive content. Either half works on its own — render Rive content through your own Renderer implementation, or drive RiveRenderer with non-Rive draw commands.

Supported Platforms & APIs

BackendHeadersClass
D3D11rive/renderer/d3d11/render_context_d3d_impl.hppRenderContextD3DImpl
D3D12rive/renderer/d3d12/render_context_d3d12_impl.hppRenderContextD3D12Impl
Metalrive/renderer/metal/render_context_metal_impl.hRenderContextMetalImpl
Vulkanrive/renderer/vulkan/render_context_vulkan_impl.hppRenderContextVulkanImpl
OpenGL / WebGLrive/renderer/gl/render_context_gl_impl.hppRenderContextGLImpl
The C++ runtime is also the foundation for Rive’s iOS/macOS, Android, and Flutter runtimes — those platforms ship a thin wrapper, not a separate engine.

Source & License