| 1 | // Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies). |
|---|---|
| 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 <Qt3DRender/private/qgeometryloaderfactory_p.h> |
| 5 | |
| 6 | #include "gltfgeometryloader.h" |
| 7 | |
| 8 | QT_BEGIN_NAMESPACE |
| 9 | |
| 10 | class GLTFGeometryLoaderPlugin : public Qt3DRender::QGeometryLoaderFactory |
| 11 | { |
| 12 | Q_OBJECT |
| 13 | Q_PLUGIN_METADATA(IID QGeometryLoaderFactory_iid FILE "gltf.json") |
| 14 | public: |
| 15 | |
| 16 | QStringList keys() const override |
| 17 | { |
| 18 | return QStringList() << GLTFGEOMETRYLOADER_EXT |
| 19 | << JSONGEOMETRYLOADER_EXT |
| 20 | << QGLTFGEOMETRYLOADER_EXT; |
| 21 | } |
| 22 | |
| 23 | Qt3DRender::QGeometryLoaderInterface *create(const QString &ext) override |
| 24 | { |
| 25 | if ((ext.compare(GLTFGEOMETRYLOADER_EXT, cs: Qt::CaseInsensitive) == 0) || |
| 26 | (ext.compare(JSONGEOMETRYLOADER_EXT, cs: Qt::CaseInsensitive) == 0) || |
| 27 | (ext.compare(QGLTFGEOMETRYLOADER_EXT, cs: Qt::CaseInsensitive) == 0)) |
| 28 | return new Qt3DRender::GLTFGeometryLoader; |
| 29 | return nullptr; |
| 30 | } |
| 31 | }; |
| 32 | |
| 33 | QT_END_NAMESPACE |
| 34 | |
| 35 | #include "main.moc" |
| 36 |
