diff options
author | Kevin Ottens <kevin.ottens@kdab.com> | 2017-02-23 16:07:18 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2017-02-24 16:59:02 +0000 |
commit | c10fa3bf20f5ac000a0ba67f2ec8e101af040d6f (patch) | |
tree | 7d131b22dfd4bf9ef8c7130228772b8b54976056 /tests/auto/render/entity | |
parent | 179045694287689d1d746a156874e95b76cd9efb (diff) |
Integrate EnvironmentLight with Entity
This will be needed to gather the environment lights in the scene.
Change-Id: Icabcfb378c4938448bd241460b0f3fa3811c0287
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'tests/auto/render/entity')
-rw-r--r-- | tests/auto/render/entity/tst_entity.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/auto/render/entity/tst_entity.cpp b/tests/auto/render/entity/tst_entity.cpp index 0bd3a6054..d1a222c92 100644 --- a/tests/auto/render/entity/tst_entity.cpp +++ b/tests/auto/render/entity/tst_entity.cpp @@ -38,6 +38,7 @@ #include <Qt3DCore/QComponentRemovedChange> #include <Qt3DCore/QTransform> +#include <Qt3DRender/QEnvironmentLight> #include <Qt3DRender/QMesh> #include <Qt3DRender/QMaterial> #include <Qt3DRender/QLayer> @@ -64,6 +65,7 @@ QNodeId computeJobUuid(Entity *entity) { return entity->componentUuid<ComputeCom QVector<QNodeId> layersUuid(Entity *entity) { return entity->componentsUuid<Layer>(); } QVector<QNodeId> shadersUuid(Entity *entity) { return entity->componentsUuid<ShaderData>(); } +QVector<QNodeId> environmentLightsUuid(Entity *entity) { return entity->componentsUuid<EnvironmentLight>(); } class tst_RenderEntity : public QObject { @@ -86,7 +88,8 @@ private slots: << new QObjectPicker << new QLayer << new QShaderData - << new QComputeCommand; + << new QComputeCommand + << new QEnvironmentLight; QTest::newRow("all components") << components; } @@ -112,6 +115,7 @@ private slots: QVERIFY(entity.componentUuid<ComputeCommand>().isNull()); QVERIFY(entity.componentsUuid<Layer>().isEmpty()); QVERIFY(entity.componentsUuid<ShaderData>().isEmpty()); + QVERIFY(entity.componentsUuid<EnvironmentLight>().isEmpty()); QVERIFY(!entity.isBoundingVolumeDirty()); QVERIFY(entity.childrenHandles().isEmpty()); @@ -139,6 +143,7 @@ private slots: QVERIFY(!entity.componentUuid<ComputeCommand>().isNull()); QVERIFY(!entity.componentsUuid<Layer>().isEmpty()); QVERIFY(!entity.componentsUuid<ShaderData>().isEmpty()); + QVERIFY(!entity.componentsUuid<EnvironmentLight>().isEmpty()); QVERIFY(entity.isBoundingVolumeDirty()); QVERIFY(!entity.childrenHandles().isEmpty()); QVERIFY(renderer.dirtyBits() != 0); @@ -157,6 +162,7 @@ private slots: QVERIFY(entity.componentUuid<QComputeCommand>().isNull()); QVERIFY(entity.componentsUuid<Layer>().isEmpty()); QVERIFY(entity.componentsUuid<ShaderData>().isEmpty()); + QVERIFY(entity.componentsUuid<EnvironmentLight>().isEmpty()); QVERIFY(!entity.isBoundingVolumeDirty()); QVERIFY(entity.childrenHandles().isEmpty()); containsAll = entity.containsComponentsOfType<Transform, CameraLens, Material, GeometryRenderer, ObjectPicker, ComputeCommand>(); @@ -236,6 +242,10 @@ private slots: components.clear(); components << new QShaderData << new QShaderData << new QShaderData; QTest::newRow("shader data") << components << reinterpret_cast<void*>(shadersUuid); + + components.clear(); + components << new QEnvironmentLight << new QEnvironmentLight << new QEnvironmentLight; + QTest::newRow("environmentLights") << components << reinterpret_cast<void*>(environmentLightsUuid); } void shouldHandleComponentsEvents() |