From 73d9dced8298dfad7bc72607146e81e96fffb6d4 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Fri, 9 Oct 2009 13:19:36 +1000 Subject: Suppress unnecessary warning messages if pbuffers are not supported Reviewed-by: trustme --- src/opengl/qglpixelbuffer_egl.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/opengl/qglpixelbuffer_egl.cpp b/src/opengl/qglpixelbuffer_egl.cpp index 2b5e2f5..744fbd4 100644 --- a/src/opengl/qglpixelbuffer_egl.cpp +++ b/src/opengl/qglpixelbuffer_egl.cpp @@ -202,13 +202,20 @@ GLuint QGLPixelBuffer::generateDynamicTexture() const bool QGLPixelBuffer::hasOpenGLPbuffers() { // See if we have at least 1 configuration that matches the default format. - QEglContext ctx; - if (!ctx.openDisplay(0)) + EGLDisplay dpy = QEglContext::defaultDisplay(0); + if (dpy == EGL_NO_DISPLAY) return false; QEglProperties configProps; qt_egl_set_format(configProps, QInternal::Pbuffer, QGLFormat::defaultFormat()); configProps.setRenderableType(QEgl::OpenGL); - return ctx.chooseConfig(configProps, QEgl::BestPixelFormat); + do { + EGLConfig cfg = 0; + EGLint matching = 0; + if (eglChooseConfig(dpy, configProps.properties(), + &cfg, 1, &matching) && matching > 0) + return true; + } while (configProps.reduceConfiguration()); + return false; } QT_END_NAMESPACE -- cgit v0.12