Example using rive and skia
Hi there,
I'm trying to get rive and skia working in a GLFW window but am having trouble. I've only got the old flare examples to go on that I've been able to find. However, a lot seems to have changed since these were written.
Do you have a simple example of at least rendering a rive file to a surface using skia?
Thank you!
~~Hi! This is an old experimental repo for the Flare C++ runtime! The new Rive one with working Skia renderer (see the Skia/viewer folder) is here: https://github.com/rive-app/rive-cpp~~
Leaving that comment for posterity, I totally misunderstood.
You have the right repo, wrong examples! You can export new compatible files (v7) from https://rive.app. You can open any file in the community and download the runtime (.riv) file for it.
Thanks for the answers (and for the fantastic product) Luigi - sorry, I should be more clear. I am developing a c++ app:
- Create GL window with GLFW (working fine)
- Create Skia GL context and surface (working fine)
- Draw manually to window using skia (e.g. draw rectangles, lines - working fine)
- Load .riv file and draw using skia <-- this is the part I'm having trouble with
For the last step I am trying to use the old flare example as a reference, but rive has changed so much since then. The code is not directly compatible (for example, I cannot find anything called an SkrActor) and there are no example projects in the new rive cpp repo.
Do you have an example of how to render any .riv file using skia once GL and skia are set up and ready?
In case anyone comes across this in the future, there is a good example in the repo but it's a bit tricky to find :) https://github.com/rive-app/rive-cpp/tree/master/skia/viewer