Output a friendly warning when makeCurrent fails
authorGunnar Sletta <gunnar.sletta@nokia.com>
Thu, 26 Jan 2012 15:46:04 +0000 (16:46 +0100)
committerQt by Nokia <qt-info@nokia.com>
Fri, 27 Jan 2012 08:55:44 +0000 (09:55 +0100)
Change-Id: Ife582717b4abc657120b98366fe6e6dc5efc7586
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/quick/items/qquickwindowmanager.cpp

index a07efea..ca9c73c 100644 (file)
@@ -335,7 +335,8 @@ void QQuickRenderThreadSingleContextWindowManager::initialize()
     // Pick up the surface format from one of them
     gl->setFormat(win->requestedFormat());
     gl->create();
-    gl->makeCurrent(win);
+    if (!gl->makeCurrent(win))
+        qWarning("QQuickCanvas: makeCurrent() failed...");
 
     Q_ASSERT(!sg->isReady());
     sg->initialize(gl);
@@ -1144,7 +1145,8 @@ void QQuickTrivialWindowManager::renderCanvas(QQuickCanvas *canvas)
         gl = new QOpenGLContext();
         gl->setFormat(canvas->requestedFormat());
         gl->create();
-        gl->makeCurrent(canvas);
+        if (!gl->makeCurrent(canvas))
+            qWarning("QQuickCanvas: makeCurrent() failed...");
         sg->initialize(gl);
     } else {
         gl->makeCurrent(canvas);