summaryrefslogtreecommitdiffstats
path: root/src/plugins/geometryloaders/gltf/main.cpp
blob: 8012190d7622187fb6386ad7156eea4aef51966e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#include <Qt3DRender/private/qgeometryloaderfactory_p.h>

#include "gltfgeometryloader.h"

QT_BEGIN_NAMESPACE

class GLTFGeometryLoaderPlugin : public Qt3DRender::QGeometryLoaderFactory
{
    Q_OBJECT
    Q_PLUGIN_METADATA(IID QGeometryLoaderFactory_iid FILE "gltf.json")
public:

    QStringList keys() const override
    {
        return QStringList() << GLTFGEOMETRYLOADER_EXT
                             << JSONGEOMETRYLOADER_EXT
                             << QGLTFGEOMETRYLOADER_EXT;
    }

    Qt3DRender::QGeometryLoaderInterface *create(const QString &ext) override
    {
        if ((ext.compare(GLTFGEOMETRYLOADER_EXT, Qt::CaseInsensitive) == 0) ||
            (ext.compare(JSONGEOMETRYLOADER_EXT, Qt::CaseInsensitive) == 0) ||
            (ext.compare(QGLTFGEOMETRYLOADER_EXT, Qt::CaseInsensitive) == 0))
            return new Qt3DRender::GLTFGeometryLoader;
        return nullptr;
    }
};

QT_END_NAMESPACE

#include "main.moc"