1// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
2// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QT3DRENDER_QRENDERPASS_H
6#define QT3DRENDER_QRENDERPASS_H
7
8#include <Qt3DRender/qt3drender_global.h>
9
10#include <Qt3DRender/qshaderprogram.h>
11#include <Qt3DRender/qrenderstate.h>
12#include <Qt3DRender/qfilterkey.h>
13
14#include <QtCore/QHash>
15
16QT_BEGIN_NAMESPACE
17
18namespace Qt3DRender {
19
20class QParameter;
21class QRenderState;
22using ParameterList = QList<QParameter *>;
23
24class QRenderPassPrivate;
25
26class Q_3DRENDERSHARED_EXPORT QRenderPass : public Qt3DCore::QNode
27{
28 Q_OBJECT
29 Q_PROPERTY(Qt3DRender::QShaderProgram *shaderProgram READ shaderProgram WRITE setShaderProgram NOTIFY shaderProgramChanged)
30
31public:
32 explicit QRenderPass(Qt3DCore::QNode *parent = nullptr);
33 ~QRenderPass();
34
35 QShaderProgram *shaderProgram() const;
36
37 void addFilterKey(QFilterKey *filterKey);
38 void removeFilterKey(QFilterKey *filterKey);
39 QList<QFilterKey *> filterKeys() const;
40
41 void addRenderState(QRenderState *state);
42 void removeRenderState(QRenderState *state);
43 QList<QRenderState *> renderStates() const;
44
45 void addParameter(QParameter *p);
46 void removeParameter(QParameter *p);
47 QList<QParameter *> parameters() const;
48
49public Q_SLOTS:
50 void setShaderProgram(QShaderProgram *shaderProgram);
51
52Q_SIGNALS:
53 void shaderProgramChanged(QShaderProgram *shaderProgram);
54
55protected:
56 explicit QRenderPass(QRenderPassPrivate &dd, Qt3DCore::QNode *parent = nullptr);
57
58private:
59 Q_DECLARE_PRIVATE(QRenderPass)
60};
61
62}
63
64QT_END_NAMESPACE
65
66#endif // QT3DRENDER_QRENDERPASS_H
67

source code of qt3d/src/render/materialsystem/qrenderpass.h