summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2016-04-27 15:28:43 +0200
committerPaul Lemire <paul.lemire@kdab.com>2016-05-20 11:12:37 +0000
commit2c7ba5ed6f9a29d0ce4374bd4aedc20fdfe513c8 (patch)
tree5565049ffbf42b94724ab86349bff2ce769fd6c5 /src
parent01758638fad44c7e05123269171c5e2e7ca0b062 (diff)
Add QTextureGenerator
Right now QTexture can provide a QTextureImageDataGenerator which doesn't make sense. This will act as a proper replacement. Change-Id: I32f412d901018d2f4f49a060cd93cd21c28941b9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/render/texture/qtexturegenerator.cpp52
-rw-r--r--src/render/texture/qtexturegenerator.h71
-rw-r--r--src/render/texture/texture.pri8
3 files changed, 128 insertions, 3 deletions
diff --git a/src/render/texture/qtexturegenerator.cpp b/src/render/texture/qtexturegenerator.cpp
new file mode 100644
index 000000000..65e615065
--- /dev/null
+++ b/src/render/texture/qtexturegenerator.cpp
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qtexturegenerator.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DRender {
+
+QTextureGenerator::~QTextureGenerator()
+{
+}
+
+} // Qt3DRender
+
+QT_END_NAMESPACE
diff --git a/src/render/texture/qtexturegenerator.h b/src/render/texture/qtexturegenerator.h
new file mode 100644
index 000000000..59bebde8c
--- /dev/null
+++ b/src/render/texture/qtexturegenerator.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3DRENDER_QTEXTUREGENERATOR_H
+#define QT3DRENDER_QTEXTUREGENERATOR_H
+
+#include <Qt3DRender/qabstractfunctor.h>
+#include <Qt3DRender/qabstracttexture.h>
+#include <Qt3DRender/qtexturewrapmode.h>
+#include <QSharedPointer>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DRender {
+
+class QTextureData;
+typedef QSharedPointer<QTextureData> QTextureDataPtr;
+
+class QT3DRENDERSHARED_EXPORT QTextureGenerator : public QAbstractFunctor
+{
+public:
+ virtual ~QTextureGenerator();
+ virtual QTextureDataPtr operator()() = 0;
+ virtual bool operator ==(const QTextureGenerator &other) const = 0;
+};
+
+typedef QSharedPointer<QTextureGenerator> QTextureGeneratorPtr;
+
+} // namespace Qt3DRender
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(Qt3DRender::QTextureGeneratorPtr)
+
+#endif // QT3DRENDER_QTEXTUREGENERATOR_H
diff --git a/src/render/texture/texture.pri b/src/render/texture/texture.pri
index 68aacd574..145a70ea8 100644
--- a/src/render/texture/texture.pri
+++ b/src/render/texture/texture.pri
@@ -15,7 +15,9 @@ HEADERS += \
$$PWD/qtextureimagedatagenerator.h \
$$PWD/qtextureimagedata_p.h \
$$PWD/qtextureimagedata.h \
- $$PWD/qtexturedata.h
+ $$PWD/qtexturedata.h \
+ $$PWD/qtextureimagedatagenerator.h \
+ $$PWD/qtexturegenerator.h
SOURCES += \
$$PWD/qabstracttextureimage.cpp \
@@ -27,5 +29,5 @@ SOURCES += \
$$PWD/qabstracttexture.cpp \
$$PWD/qtexture.cpp \
$$PWD/qtextureimagedata.cpp \
- $$PWD/qtexturedata.cpp
-
+ $$PWD/qtexturedata.cpp \
+ $$PWD/qtexturegenerator.cpp