> ## Documentation Index
> Fetch the complete documentation index at: https://rive.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# C++ Runtime

> Load, advance, and render Rive content from C++.

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](/runtimes/cpp/renderers) (Metal, Vulkan, D3D11, D3D12,
OpenGL/WebGL) or [your own implementation](/runtimes/cpp/external-renderer).

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.

<CardGroup cols={2}>
  <Card title="Getting Started" icon="rocket" href="/runtimes/cpp/getting-started">
    Build the runtime and put a `.riv` file on screen in under 100 lines of code.
  </Card>

  <Card title="Renderers" icon="microchip" href="/runtimes/cpp/renderers">
    Set up the GPU backend for your platform — D3D11, D3D12, Metal, Vulkan, or GL.
  </Card>

  <Card title="File & Artboard" icon="file" href="/runtimes/cpp/file-and-artboard">
    Import `.riv` files, query artboards, and create `ArtboardInstance`s.
  </Card>

  <Card title="State Machines" icon="diagram-project" href="/runtimes/cpp/state-machines">
    Advance scenes, forward pointer events, and react to state changes.
  </Card>

  <Card title="Data Binding" icon="link" href="/runtimes/cpp/data-binding">
    Drive a Rive `ViewModel` from your application state.
  </Card>

  <Card title="Asset Loading" icon="folder-open" href="/runtimes/cpp/asset-loading">
    Resolve out-of-band images, fonts, and audio with `FileAssetLoader`.
  </Card>

  <Card title="Rendering Loop" icon="rotate" href="/runtimes/cpp/rendering-loop">
    `beginFrame` / `flush` — what runs each frame and what it costs.
  </Card>

  <Card title="External Renderer" icon="puzzle-piece" href="/runtimes/cpp/external-renderer">
    Implement `Renderer` and `Factory` to use your own GPU backend.
  </Card>
</CardGroup>

## Architecture at a Glance

<img src="https://mintcdn.com/rive/-zQ3UMgRdEXnI1Fd/images/runtimes/cpp/rive_pipeline.png?fit=max&auto=format&n=-zQ3UMgRdEXnI1Fd&q=85&s=1bd9c8814b030bf4650244d6871b1d97" alt="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." width="1280" height="800" data-path="images/runtimes/cpp/rive_pipeline.png" />

**`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

| Backend        | Headers                                               | Class                     |
| -------------- | ----------------------------------------------------- | ------------------------- |
| D3D11          | `rive/renderer/d3d11/render_context_d3d_impl.hpp`     | `RenderContextD3DImpl`    |
| D3D12          | `rive/renderer/d3d12/render_context_d3d12_impl.hpp`   | `RenderContextD3D12Impl`  |
| Metal          | `rive/renderer/metal/render_context_metal_impl.h`     | `RenderContextMetalImpl`  |
| Vulkan         | `rive/renderer/vulkan/render_context_vulkan_impl.hpp` | `RenderContextVulkanImpl` |
| OpenGL / WebGL | `rive/renderer/gl/render_context_gl_impl.hpp`         | `RenderContextGLImpl`     |

<Note>
  The C++ runtime is also the foundation for Rive's [iOS/macOS](/runtimes/apple),
  [Android](/runtimes/android), and [Flutter](/runtimes/flutter) runtimes — those
  platforms ship a thin wrapper, not a separate engine.
</Note>

## Source & License

* GitHub: [rive-app/rive-runtime](https://github.com/rive-app/rive-runtime)
* License: MIT
* Build system: [premake5](https://premake.github.io/)
