diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2014-09-29 17:19:36 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2014-10-03 21:18:41 +0200 |
commit | 7b26f6a1746419161a8f875e341b3e31220f4141 (patch) | |
tree | f784e568015e1f7f199abb388b97fefdb158c84e /examples/deferred-renderer-cpp/main.cpp | |
parent | c16689bb1ccf31416df7b8c69fe032898cf87dec (diff) |
QNode refactoring
Move almost everything to private classes.
Assimp loading restored.
All examples working.
QNode hierachy is now handled through QObject::setParent, addChild,
removeChild are part of the private api.
Note: commented QChangeArbiter unit tests as they can no longer work with this
patch and will restore them when QChangeArbiter will have been made private.
Task-number: QTBUG-41470
Task-number: QTBUG-41523
Change-Id: I4430974b3aa7f3744c38714b451b122e0cb4d0c9
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples/deferred-renderer-cpp/main.cpp')
-rw-r--r-- | examples/deferred-renderer-cpp/main.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/examples/deferred-renderer-cpp/main.cpp b/examples/deferred-renderer-cpp/main.cpp index d331f672f..e262f129d 100644 --- a/examples/deferred-renderer-cpp/main.cpp +++ b/examples/deferred-renderer-cpp/main.cpp @@ -137,7 +137,7 @@ int main(int ac, char **av) rootEntity->addComponent(frameGraph); // Scene Content - Qt3D::QEntity *sphereOne = new Qt3D::QEntity(); + Qt3D::QEntity *sphereOne = new Qt3D::QEntity(rootEntity); Qt3D::QMaterial *sphereOneMaterial = new Qt3D::QMaterial(); sphereOneMaterial->setEffect(sceneEffect); @@ -158,7 +158,7 @@ int main(int ac, char **av) sphereOne->addComponent(sceneLayer); sphereOne->addComponent(light2); - Qt3D::QEntity *sphereTwo = new Qt3D::QEntity(); + Qt3D::QEntity *sphereTwo = new Qt3D::QEntity(rootEntity); Qt3D::QMaterial *sphereTwoMaterial = new Qt3D::QMaterial(); sphereTwoMaterial->setEffect(sceneEffect); sphereTwoMaterial->addParameter(new Qt3D::QParameter(QStringLiteral("meshColor"), QColor(Qt::yellow))); @@ -173,7 +173,7 @@ int main(int ac, char **av) sphereTwo->addComponent(light3); // Screen Quad - Qt3D::QEntity *screenQuad = new Qt3D::QEntity(); + Qt3D::QEntity *screenQuad = new Qt3D::QEntity(rootEntity); Qt3D::QMaterial *screenQuadMaterial = new Qt3D::QMaterial(); screenQuadMaterial->addParameter(new Qt3D::QParameter(QStringLiteral("position"), gBuffer->positionTexture())); screenQuadMaterial->addParameter(new Qt3D::QParameter(QStringLiteral("normal"), gBuffer->normalTexture())); @@ -190,10 +190,6 @@ int main(int ac, char **av) screenQuad->addComponent(screenQuadMaterial); screenQuad->addComponent(planeMesh); - rootEntity->addChild(sphereOne); - rootEntity->addChild(sphereTwo); - rootEntity->addChild(screenQuad); - // Set root object of the scene view.setRootObject(rootEntity); // Show window |