rendercontrol example: calculate fbo size correctly
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>
Tue, 16 Dec 2014 12:59:10 +0000 (13:59 +0100)
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>
Wed, 17 Dec 2014 14:56:45 +0000 (15:56 +0100)
Take device pixel ratio into account.

Change-Id: I729d562ad9523e11ee304136f668f496d4e00f37
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
examples/quick/rendercontrol/window.cpp

index 4813936..f34401b 100644 (file)
@@ -139,7 +139,7 @@ void Window::createFbo()
 {
     // The scene graph has been initialized. It is now time to create an FBO and associate
     // it with the QQuickWindow.
-    m_fbo = new QOpenGLFramebufferObject(size(), QOpenGLFramebufferObject::CombinedDepthStencil);
+    m_fbo = new QOpenGLFramebufferObject(size() * devicePixelRatio(), QOpenGLFramebufferObject::CombinedDepthStencil);
     m_quickWindow->setRenderTarget(m_fbo);
 }