rive-app / rive-cpp

C++ runtime for Rive
MIT License
278 stars 42 forks source link

Abstract Renderer Documentation #361

Open CorbinSteele opened 1 year ago

CorbinSteele commented 1 year ago

Is there any regularly updated documentation or example for what the Abstract Renderer actually provides or expects? Such as documentation explaining renderer.hpp, factory.hpp, and what exactly each virtual method is meant to do? It's not necessarily obvious to those unfamiliar with Skia, since most of the concrete implementations seem to be simple static casts to Skia datatypes or pass-through functions without any insight into the exposed rive-cpp data structures. Alternatively, is there a list with updated links to other working renderer implementations using modern rive-cpp? This is the closest I can find:

We provide a rendering abstraction layer that makes for a pluggable rendering architecture.
Skia is one such solution that we provide Renderer bindings for (we also provide one for Web Canvas,
a low level OpenGL tessellating renderer, a CoreGraphics renderer, and some other third party ones).

Originally posted by @luigi-rosso in https://github.com/rive-app/rive-cpp/issues/357#issuecomment-1418441297

Except that this comment doesn't provide links to any of these Renderer binding implementations, the skia_renderer.cpp link in the main README has been broken for at least a year (#347), and it's no longer immediately clear where the abstraction layer ends and the concrete implementation begins (especially with text content). There also doesn't seem to be any branch of this repo without a concrete rendering implementation and the Viewer. Perhaps it's low priority, but having a 'clean' runtime-only repo branch, which would help distinguish the abstract renderer from the concrete and allow for easier inclusion in other projects, would be quite convenient.

In short: I think this project would greatly benefit from having a well-defined and well-documented Renderer API.

Other Related Issues:

136 This seems like it would've been tremendously helpful, but was seemingly abandoned before much progress was made.

122 This seems like a clear possible use case now that Godot 4.1 is about to release. While a GDExtension integration would likely still need something like Skia, the particular implementation used here would probably need to be modified.

rive-webgl The ideas in this README seem great, but no progress on them seems to have been made recently.