| 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 | #ifndef QT3DRENDER_QENVIRONMENTLIGHT_H |
| 5 | #define QT3DRENDER_QENVIRONMENTLIGHT_H |
| 6 | |
| 7 | #include <Qt3DRender/qt3drender_global.h> |
| 8 | #include <Qt3DCore/qcomponent.h> |
| 9 | |
| 10 | QT_BEGIN_NAMESPACE |
| 11 | |
| 12 | namespace Qt3DRender { |
| 13 | |
| 14 | class QAbstractTexture; |
| 15 | class QEnvironmentLightPrivate; |
| 16 | |
| 17 | class Q_3DRENDERSHARED_EXPORT QEnvironmentLight : public Qt3DCore::QComponent |
| 18 | { |
| 19 | Q_OBJECT |
| 20 | Q_PROPERTY(Qt3DRender::QAbstractTexture *irradiance READ irradiance WRITE setIrradiance NOTIFY irradianceChanged) |
| 21 | Q_PROPERTY(Qt3DRender::QAbstractTexture *specular READ specular WRITE setSpecular NOTIFY specularChanged) |
| 22 | |
| 23 | public: |
| 24 | explicit QEnvironmentLight(Qt3DCore::QNode *parent = nullptr); |
| 25 | ~QEnvironmentLight(); |
| 26 | |
| 27 | Qt3DRender::QAbstractTexture *irradiance() const; |
| 28 | Qt3DRender::QAbstractTexture *specular() const; |
| 29 | |
| 30 | public Q_SLOTS: |
| 31 | void setIrradiance(Qt3DRender::QAbstractTexture *irradiance); |
| 32 | void setSpecular(Qt3DRender::QAbstractTexture *specular); |
| 33 | |
| 34 | protected: |
| 35 | explicit QEnvironmentLight(QEnvironmentLightPrivate &dd, Qt3DCore::QNode *parent = nullptr); |
| 36 | |
| 37 | Q_SIGNALS: |
| 38 | void irradianceChanged(Qt3DRender::QAbstractTexture *environmentIrradiance); |
| 39 | void specularChanged(Qt3DRender::QAbstractTexture *environmentSpecular); |
| 40 | |
| 41 | private: |
| 42 | Q_DECLARE_PRIVATE(QEnvironmentLight) |
| 43 | |
| 44 | Q_PRIVATE_SLOT(d_func(), void _q_updateEnvMapsSize()) |
| 45 | }; |
| 46 | |
| 47 | } // namespace Qt3DRender |
| 48 | |
| 49 | QT_END_NAMESPACE |
| 50 | |
| 51 | #endif // QT3DRENDER_QENVIRONMENTLIGHT_H |
| 52 | |