| 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 | |
| 8 | QT_BEGIN_NAMESPACE |
| 9 | |
| 10 | namespace Qt3DRender { |
| 11 | namespace Render { |
| 12 | |
| 13 | using namespace Qt3DCore; |
| 14 | |
| 15 | QNodeId EnvironmentLight::shaderData() const |
| 16 | { |
| 17 | return m_shaderDataId; |
| 18 | } |
| 19 | |
| 20 | void 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 | |
| 36 | QT_END_NAMESPACE |
| 37 |
