aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph/vulkanunderqml
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2019-08-30 13:13:54 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2019-09-08 09:42:11 +0200
commitba3e72ab7e4c43806259b1de8f646bfd841d24e0 (patch)
tree7d7c2013671c5232d1a73b76e98c4ed138775a51 /examples/quick/scenegraph/vulkanunderqml
parent1a5c6544c88d6092ca57e780e332a0f302041b06 (diff)
Clarify docs and comments regarding under and overlays
Change-Id: I8973798996b6c775f425819af1d6a09f1773a9dc Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'examples/quick/scenegraph/vulkanunderqml')
-rw-r--r--examples/quick/scenegraph/vulkanunderqml/vulkansquircle.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/quick/scenegraph/vulkanunderqml/vulkansquircle.cpp b/examples/quick/scenegraph/vulkanunderqml/vulkansquircle.cpp
index 3f2067a803..59e9606e7b 100644
--- a/examples/quick/scenegraph/vulkanunderqml/vulkansquircle.cpp
+++ b/examples/quick/scenegraph/vulkanunderqml/vulkansquircle.cpp
@@ -186,7 +186,12 @@ void VulkanSquircle::sync()
{
if (!m_renderer) {
m_renderer = new SquircleRenderer;
+ // Initializing resources is done before starting to record the
+ // renderpass, regardless of wanting an underlay or overlay.
connect(window(), &QQuickWindow::beforeRendering, m_renderer, &SquircleRenderer::frameStart, Qt::DirectConnection);
+ // Here we want an underlay and therefore connect to
+ // beforeRenderPassRecording. Changing to afterRenderPassRecording
+ // would render the squircle on top (overlay).
connect(window(), &QQuickWindow::beforeRenderPassRecording, m_renderer, &SquircleRenderer::mainPassRecordingStart, Qt::DirectConnection);
}
m_renderer->setViewportSize(window()->size() * window()->devicePixelRatio());