Hello,
I am trying to convert my application to GTK4 (initially merely trying to see how much work is needed to do so).
It uses GtkGLArea extensively. My application works without OpenGL errors in GTK3, but the GTK4 version sets a GL error (1282) after gtk_gl_area_attach_buffers() has been called. Additionally, and may be related, there are framebuffer errors (glCheckFramebufferStatus() fails) in the GTK4 version (but not using GTK3). Much of the other OpenGL setup code works OK though. So have I missed something with regards to setting up framebuffers that I need to do in GTK4 that is not needed in GTK3? Maybe I am calling gtk_gl_area_attach_buffers() from the wrong place? I note that the documentation says that gtk_gl_area_attach_buffers() should not be needed much in user code, but I have found that I needed it extensively when making mesh buffers.
Maybe this question should be in “Platform” - I am not sure.
Are you doing drawing outside the render callback? Or can you show the render callback you are using? I remember having similar problems but cannot remember the details, it is possible your GL context is not getting set up correctly.
That was it! I got rid of the hack and found there was some problem with “linking” the realize() and render() callbacks - when the callback functions were in the same file (and above their invocation) then it worked! I really appreciate your insight.