1// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "rendertargetselectornode_p.h"
5#include <Qt3DCore/private/qchangearbiter_p.h>
6#include <Qt3DRender/qrendertargetselector.h>
7#include <Qt3DRender/private/qrendertargetselector_p.h>
8#include <Qt3DRender/qrendertarget.h>
9#include <Qt3DRender/private/renderlogging_p.h>
10#include <Qt3DRender/qrendertargetoutput.h>
11
12QT_BEGIN_NAMESPACE
13
14using namespace Qt3DCore;
15
16namespace Qt3DRender {
17namespace Render {
18
19RenderTargetSelector::RenderTargetSelector() :
20 FrameGraphNode(FrameGraphNode::RenderTarget)
21{
22}
23
24void RenderTargetSelector::syncFromFrontEnd(const QNode *frontEnd, bool firstTime)
25{
26 const QRenderTargetSelector *node = qobject_cast<const QRenderTargetSelector *>(object: frontEnd);
27 if (!node)
28 return;
29
30 FrameGraphNode::syncFromFrontEnd(frontEnd, firstTime);
31
32 const QNodeId renderTargetId = qIdForNode(node: node->target());
33 if (renderTargetId != m_renderTargetUuid) {
34 m_renderTargetUuid = renderTargetId;
35 markDirty(changes: AbstractRenderer::FrameGraphDirty);
36 }
37}
38
39} // namespace Render
40} // namespace Qt3DRender
41
42QT_END_NAMESPACE
43

source code of qt3d/src/render/framegraph/rendertargetselectornode.cpp