1// Copyright (C) 2017 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 "environmentlight_p.h"
5#include "qenvironmentlight.h"
6#include "qenvironmentlight_p.h"
7
8QT_BEGIN_NAMESPACE
9
10using namespace Qt3DCore;
11
12namespace Qt3DRender {
13namespace Render {
14
15QNodeId EnvironmentLight::shaderData() const
16{
17 return m_shaderDataId;
18}
19
20void EnvironmentLight::syncFromFrontEnd(const QNode *frontEnd, bool firstTime)
21{
22 BackendNode::syncFromFrontEnd(frontEnd, firstTime);
23 const QEnvironmentLight *node = qobject_cast<const QEnvironmentLight *>(object: frontEnd);
24 if (!node)
25 return;
26
27 if (firstTime) {
28 QEnvironmentLightPrivate *d = static_cast<QEnvironmentLightPrivate *>(QEnvironmentLightPrivate::get(q: const_cast<Qt3DCore::QNode *>(frontEnd)));
29 m_shaderDataId = d->m_shaderData ? d->m_shaderData->id() : QNodeId{};
30 }
31}
32
33} // namespace Render
34} // namespace Qt3DRender
35
36QT_END_NAMESPACE
37

source code of qt3d/src/render/lights/environmentlight.cpp