Closed iomeone closed 15 hours ago
Haven't tried yet, but should definately be possible.
Let's keep it open, going to have a look
I've started doing some changes but unluckily my windows VM only supports GL up to 3.3 and Rive needs at least 4.2 so i'm unable to validate that the changes work. Can try to open a PR and you can try tomorrow.
I started working on https://github.com/kunitoki/yup/pull/24 which should allow better rendering backend selection. Still not perfect, but should be possible to enable opengl on windows.
You will have to define YUP_RIVE_USE_OPENGL=1
when configuring your application (in cmake as PUBLIC definition), then when you create a yup::DocumentWindow
, you can pass opengl as context api to use:
struct MyWindow : public yup::DocumentWindow
{
MyWindow()
: yup::DocumentWindow(yup::ComponentNative::Options()
.withGraphicsApi(yup::GraphicsContext::OpenGL))
{}
};
Beware i haven't tested it for running.
I was able to build it for the opengl branch on windows 10 with vs2022, but when I ran it, nothing appeared. Then, I investigated further.
In the function:
void GLFWComponentNative::renderContext()
I added:
glfwSwapBuffers (window);
right after:
context->tick();
After making this change, the animation started to display!
Nice! Will give it a spin and update the PR
I have updated the PR with the changes you suggested. Please let me know if it's working for you, it would be nice if you could send here some screenshots of your app running !
Yes, the current code on the main branch can run using OpenGL. Thank you!
How can I enable OpenGL rendering on the Windows platform? I've been trying for a long time without success, and I hope you can provide some suggestions.