diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2016-04-03 11:02:25 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-04-10 21:09:36 +0000 |
commit | 5964a47d20cfd5164f67e87ad722382bbdcb9731 (patch) | |
tree | cce20798250cdb68a2cd3fc071e967897d2dff75 | |
parent | fd254b66e02b2128127eab52eb070e9928891d50 (diff) |
QCullFace creates creation changes
Change-Id: Ib06ce379ad2aaa6abca4f5d0f6c3301ad0c59577
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r-- | src/render/renderstates/qcullface.cpp | 27 | ||||
-rw-r--r-- | src/render/renderstates/qcullface.h | 1 | ||||
-rw-r--r-- | src/render/renderstates/qcullface_p.h | 80 | ||||
-rw-r--r-- | src/render/renderstates/renderstates.pri | 3 |
4 files changed, 94 insertions, 17 deletions
diff --git a/src/render/renderstates/qcullface.cpp b/src/render/renderstates/qcullface.cpp index 45f1d0f99..d2cc54b63 100644 --- a/src/render/renderstates/qcullface.cpp +++ b/src/render/renderstates/qcullface.cpp @@ -39,27 +39,13 @@ ****************************************************************************/ #include "qcullface.h" -#include <private/qnode_p.h> -#include "qrenderstate_p.h" -#include <Qt3DCore/qscenepropertychange.h> +#include "qcullface_p.h" +#include <Qt3DRender/private/qrenderstatecreatedchange_p.h> QT_BEGIN_NAMESPACE namespace Qt3DRender { -class QCullFacePrivate : public QRenderStatePrivate -{ -public: - QCullFacePrivate() - : QRenderStatePrivate(QRenderStatePrivate::CullFace) - , m_mode(QCullFace::Back) - { - } - - Q_DECLARE_PUBLIC(QCullFace) - QCullFace::CullingMode m_mode; -}; - QCullFace::QCullFace(QNode *parent) : QRenderState(*new QCullFacePrivate, parent) { @@ -92,6 +78,15 @@ void QCullFace::setMode(QCullFace::CullingMode mode) } } +Qt3DCore::QNodeCreatedChangeBasePtr QCullFace::createNodeCreationChange() const +{ + auto creationChange = QRenderStateCreatedChangePtr<QCullFaceData>::create(this); + auto &data = creationChange->data; + Q_D(const QCullFace); + data.mode = d->m_mode; + return creationChange; +} + } // namespace Qt3DRender QT_END_NAMESPACE diff --git a/src/render/renderstates/qcullface.h b/src/render/renderstates/qcullface.h index d07c9a9a8..1b0f1df21 100644 --- a/src/render/renderstates/qcullface.h +++ b/src/render/renderstates/qcullface.h @@ -82,6 +82,7 @@ protected: private: Q_DECLARE_PRIVATE(QCullFace) QT3D_CLONEABLE(QCullFace) + Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; } // namespace Qt3DRender diff --git a/src/render/renderstates/qcullface_p.h b/src/render/renderstates/qcullface_p.h new file mode 100644 index 000000000..7bb1b85e8 --- /dev/null +++ b/src/render/renderstates/qcullface_p.h @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT3DRENDER_QCULLFACE_P_H +#define QT3DRENDER_QCULLFACE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <Qt3DRender/private/qrenderstate_p.h> +#include <Qt3DRender/qcullface.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3DRender { + +class QCullFacePrivate : public QRenderStatePrivate +{ +public: + QCullFacePrivate() + : QRenderStatePrivate(QRenderStatePrivate::CullFace) + , m_mode(QCullFace::Back) + { + } + + Q_DECLARE_PUBLIC(QCullFace) + QCullFace::CullingMode m_mode; +}; + +struct QCullFaceData +{ + QCullFace::CullingMode mode; +}; + +} // namespace Qt3DRender + +QT_END_NAMESPACE + +#endif // QT3DRENDER_QCULLFACE_P_H diff --git a/src/render/renderstates/renderstates.pri b/src/render/renderstates/renderstates.pri index fb27eeede..fc482f3a3 100644 --- a/src/render/renderstates/renderstates.pri +++ b/src/render/renderstates/renderstates.pri @@ -32,7 +32,8 @@ HEADERS += \ $$PWD/qblendequation_p.h \ $$PWD/qblendequationarguments_p.h \ $$PWD/qclipplane_p.h \ - $$PWD/qcolormask_p.h + $$PWD/qcolormask_p.h \ + $$PWD/qcullface_p.h SOURCES += \ |