1// Copyright (C) 2016 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 <private/backendnode_p.h>
5#include <private/abstractrenderer_p.h>
6#include <private/resourceaccessor_p.h>
7#include <private/nodemanagers_p.h>
8#include <Qt3DCore/private/qbackendnode_p.h>
9#include <Qt3DCore/qnode.h>
10
11QT_BEGIN_NAMESPACE
12
13using namespace Qt3DCore;
14
15namespace Qt3DRender {
16namespace Render {
17
18BackendNode::BackendNode(Mode mode)
19 : QBackendNode(mode)
20 , m_renderer(nullptr)
21{
22}
23
24BackendNode::BackendNode(Qt3DCore::QBackendNodePrivate &dd)
25 : QBackendNode(dd)
26 , m_renderer(nullptr)
27{
28}
29
30BackendNode::~BackendNode()
31{
32}
33
34void BackendNode::setRenderer(AbstractRenderer *renderer)
35{
36 m_renderer = renderer;
37}
38
39AbstractRenderer *BackendNode::renderer() const
40{
41 return m_renderer;
42}
43
44void BackendNode::markDirty(AbstractRenderer::BackendNodeDirtySet changes)
45{
46 Q_ASSERT(m_renderer);
47 m_renderer->markDirty(changes, node: this);
48}
49
50QSharedPointer<RenderBackendResourceAccessor> BackendNode::resourceAccessor() const
51{
52 return m_renderer->resourceAccessor();
53}
54
55void BackendNode::syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime)
56{
57 Q_UNUSED(firstTime);
58
59 d_ptr->setEnabled(frontEnd->isEnabled());
60}
61
62} // namespace Render
63} // namespace Qt3DRender
64
65QT_END_NAMESPACE
66

source code of qt3d/src/render/backend/backendnode.cpp