summaryrefslogtreecommitdiffstats
path: root/src/render/frontend
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2015-03-16 08:13:20 +0100
committerSean Harmer <sean.harmer@kdab.com>2015-04-25 15:52:52 +0000
commita04baa706c460c53ab7fa94c5983e55cac15a1c1 (patch)
tree0a0e68e5f0d78c99d1c613fa6e6fe1eb5534108c /src/render/frontend
parentfb5816c2760c45f9ed3c58ac263f6d47cdacc6ca (diff)
QNoDraw FrameGraph node added
This will offer a way of preventing a RenderView from processing meshes but rather only setting rendering states and/or clearing buffers. Change-Id: I76b9f8c0b3e8410944e9e80f3d6688416adf2edf Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/frontend')
-rw-r--r--src/render/frontend/framegraph-components/framegraph-components.pri6
-rw-r--r--src/render/frontend/framegraph-components/qnodraw.cpp69
-rw-r--r--src/render/frontend/framegraph-components/qnodraw.h60
3 files changed, 133 insertions, 2 deletions
diff --git a/src/render/frontend/framegraph-components/framegraph-components.pri b/src/render/frontend/framegraph-components/framegraph-components.pri
index 75df1b20f..b26f70185 100644
--- a/src/render/frontend/framegraph-components/framegraph-components.pri
+++ b/src/render/frontend/framegraph-components/framegraph-components.pri
@@ -24,7 +24,8 @@ HEADERS += \
$$PWD/qframegraphselector.h \
$$PWD/qframegraphselector_p.h \
$$PWD/qstateset.h \
- $$PWD/qstateset_p.h
+ $$PWD/qstateset_p.h \
+ $$PWD/qnodraw.h
SOURCES += \
$$PWD/qframegraph.cpp \
@@ -39,6 +40,7 @@ SOURCES += \
$$PWD/qsortcriterion.cpp \
$$PWD/qframegraphnode.cpp \
$$PWD/qframegraphselector.cpp \
- $$PWD/qstateset.cpp
+ $$PWD/qstateset.cpp \
+ $$PWD/qnodraw.cpp
INCLUDEPATH += $$PWD
diff --git a/src/render/frontend/framegraph-components/qnodraw.cpp b/src/render/frontend/framegraph-components/qnodraw.cpp
new file mode 100644
index 000000000..0c11f5b34
--- /dev/null
+++ b/src/render/frontend/framegraph-components/qnodraw.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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$
+**
+****************************************************************************/
+
+#include "qnodraw.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+/*!
+ * \class Qt3D::QNoDraw::QNoDraw
+ *
+ * \brief When a Qt3D::QNoDraw node is present in a FrameGraph branch, this
+ * prevents the renderer from rendering any primitive.
+ *
+ * Qt3D::QNoDraw should be used when the FrameGraph needs to set up some render
+ * states or clear some buffers without requiring any mesh to be drawn. It has
+ * the same effect as having a Qt3D::QRenderPassFilter that matches none of
+ * available Qt3D::QRenderPass instances of the scene without the overhead cost
+ * of actually performing the filtering.
+ *
+ * \since 5.5
+ */
+
+QNoDraw::QNoDraw(QNode *parent)
+ : QFrameGraphNode(parent)
+{
+}
+
+QNoDraw::~QNoDraw()
+{
+}
+
+} // Qt3D
+
+QT_END_NAMESPACE
diff --git a/src/render/frontend/framegraph-components/qnodraw.h b/src/render/frontend/framegraph-components/qnodraw.h
new file mode 100644
index 000000000..cbe7a3fb8
--- /dev/null
+++ b/src/render/frontend/framegraph-components/qnodraw.h
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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 QT3D_QNODRAW_H
+#define QT3D_QNODRAW_H
+
+#include <Qt3DRenderer/qframegraphnode.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3D {
+
+class QNoDraw : public QFrameGraphNode
+{
+public:
+ explicit QNoDraw(QNode *parent = 0);
+ ~QNoDraw();
+
+private:
+ QT3D_CLONEABLE(QNoDraw)
+};
+
+} // Qt3D
+
+QT_END_NAMESPACE
+
+#endif // QT3D_QNODRAW_H