Depth issues with GtkGLArea

Viewed 69

I'm working on a Golang GTK3 OpenGL app and I'm running into issues with the depth buffer. If I compile go-gl's cube example, it works fine. However, the same example, modified to replace GLFW with GTK (source), shows depth artifacts. 100% of the OpenGL code is copy and pasted, except where I added a debug callback. The only thing that's different is GTK vs GLFW and code organization.

I have never done much with OpenGL and this has me totally stumped.

Video (Imgur)

Image

1 Answers

Apparently, by default GtkGLArea does not have a depth buffer. So this issue can be fixed with:

glarea.SetHasDepthBuffer(true)

Or in C

gtk_gl_area_set_has_depth_buffer(glarea, TRUE);
Related