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?
The reason why I ask is, this app works fine on Linux (OpenGL 3.2), but segfaults in a libepoxy call on macOS 12 (OpenGL 4.1). I’m wondering if this is libepoxy related, or maybe because of a bad interaction between GTK and libepoxy. The app does a few GL calls before segfault (glGetError returns 0 after every call) and then segfaults in glViewport in libepoxy.
Thanks. Does that mean I’m using the right GL functions that GTK is also using, and the problem is not some kind of incompatibility between GTK’s GL functions and my apps?
It could entirely be an issue of the macOS backend in GDK; I would recommend creating a small, self-contained example that exhibits the same crash in C, and then opening an issue on the GTK issue tracker.