highgui: enable depth buffer for GTK3 GtkGLArea so GL_DEPTH_TEST works

This commit is contained in:
kirtijindal14
2026-07-30 14:14:31 +05:30
parent 89bff6b47c
commit f3bdb6cf01

View File

@@ -1069,6 +1069,8 @@ static std::shared_ptr<CvWindow> namedWindow_(const std::string& name, int flags
#if defined(HAVE_OPENGL) && defined(GTK_VERSION3)
if (flags & cv::WINDOW_OPENGL) {
window->glArea = gtk_gl_area_new();
// GtkGLArea has no depth buffer by default; request one so GL_DEPTH_TEST works.
gtk_gl_area_set_has_depth_buffer(GTK_GL_AREA(window->glArea), TRUE);
gtk_container_add(GTK_CONTAINER(window->frame), window->glArea);
gtk_widget_show(window->glArea);
} else {