diff options
author | Mike Krus <mike.krus@kdab.com> | 2016-03-16 22:41:28 +0000 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-03-20 18:52:47 +0000 |
commit | f837692f5b8579125335624ea7228a4edb5897b5 (patch) | |
tree | 43959de808fe9c13cee9d229b4b3c1254ca47375 /src/render/framegraph/clearbuffers.cpp | |
parent | ad5fe1d0469edb2a250640a2e13c8cf97b07d870 (diff) |
Rename QClearBuffer to QClearBuffers
Task-number: QTBUG-51460
Change-Id: I3f522f5eaea7bf0f94dbcdc1e7463f2827c0fe3b
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/framegraph/clearbuffers.cpp')
-rw-r--r-- | src/render/framegraph/clearbuffers.cpp | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/render/framegraph/clearbuffers.cpp b/src/render/framegraph/clearbuffers.cpp new file mode 100644 index 000000000..41f9d563e --- /dev/null +++ b/src/render/framegraph/clearbuffers.cpp @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 "clearbuffers_p.h" +#include <Qt3DCore/qscenepropertychange.h> + +QT_BEGIN_NAMESPACE + +using namespace Qt3DCore; + +namespace Qt3DRender { +namespace Render { + +ClearBuffers::ClearBuffers() + : FrameGraphNode(FrameGraphNode::ClearBuffers) + , m_type(QClearBuffers::None) +{ +} + +void ClearBuffers::updateFromPeer(Qt3DCore::QNode *peer) +{ + QClearBuffers *clearBuffers = static_cast<QClearBuffers *>(peer); + m_type = clearBuffers->buffers(); + setEnabled(clearBuffers->isEnabled()); +} + +void ClearBuffers::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) +{ + if (e->type() == NodeUpdated) { + QScenePropertyChangePtr propertyChange = qSharedPointerCast<QScenePropertyChange>(e); + if (propertyChange->propertyName() == QByteArrayLiteral("buffers")) + m_type = static_cast<QClearBuffers::BufferType>(propertyChange->value().toInt()); + else if (propertyChange->propertyName() == QByteArrayLiteral("enabled")) + setEnabled(propertyChange->value().toBool()); + markDirty(AbstractRenderer::AllDirty); + } +} + +QClearBuffers::BufferType ClearBuffers::type() const +{ + return m_type; +} + +} // namespace Render +} // namespace Qt3DRender + +QT_END_NAMESPACE |