Recommended way of loading OpenGL functions in GTK4 apps?

I have a Rust GTK4 app (using the latest gtk4 crate) that renders on a GLArea using OpenGL.

Currently I'm calling OpenGL functions via epoxy, which is a bindings crate for libepoxy.

I don't remember how I came up with this approach and I'm wondering if this is the recommended way of using OpenGL in GTK4 applications to draw stuff on a GtkGLArea.

I think GTK4 renders its own widgets using OpenGL (correct me if I'm wrong), so it should be loading OpenGL functions. Can I not use the same ones that it's already loading?

You might get a better response in the Gtk Forum.

Thanks. I tried to ask there now but my question is waiting for moderator approval.

In case anyone here knows the answer, I created a minimal repro: GitHub - osa1/gtk_segfault_repro.

On Linux it works fine. On macOS it segfaults in glViewport call.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.