When going through GtkGLArea examples, I noticed that all of them use the “realize” signal callback function for resource creation (vertex buffers, etc.).
However, I am programming a level editor and nothing about the level contents are known during the call to “realize”, so I cannot create any GL resources here. It would be practical to create such resources outside of that function, more specifically when the user open a level file.
So, is it possible to create GL resources outside of the GtkGLArea signal callbacks? If so, how?
I tried calling GL functions outside of the signal callback functions, but it simply does not work. Looks like it is colliding with a different internal-to-GTK4 GL context.