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 | |
16 | QT_BEGIN_NAMESPACE |
17 | |
18 | namespace Qt3DRender { |
19 | |
20 | class QParameter; |
21 | class QRenderState; |
22 | using ParameterList = QList<QParameter *>; |
23 | |
24 | class QRenderPassPrivate; |
25 | |
26 | class Q_3DRENDERSHARED_EXPORT QRenderPass : public Qt3DCore::QNode |
27 | { |
28 | Q_OBJECT |
29 | Q_PROPERTY(Qt3DRender::QShaderProgram *shaderProgram READ shaderProgram WRITE setShaderProgram NOTIFY shaderProgramChanged) |
30 | |
31 | public: |
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 | |
49 | public Q_SLOTS: |
50 | void setShaderProgram(QShaderProgram *shaderProgram); |
51 | |
52 | Q_SIGNALS: |
53 | void shaderProgramChanged(QShaderProgram *shaderProgram); |
54 | |
55 | protected: |
56 | explicit QRenderPass(QRenderPassPrivate &dd, Qt3DCore::QNode *parent = nullptr); |
57 | |
58 | private: |
59 | Q_DECLARE_PRIVATE(QRenderPass) |
60 | }; |
61 | |
62 | } |
63 | |
64 | QT_END_NAMESPACE |
65 | |
66 | #endif // QT3DRENDER_QRENDERPASS_H |
67 | |