1// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QT3DRENDER_QRENDERTARGETOUTPUT_H
5#define QT3DRENDER_QRENDERTARGETOUTPUT_H
6
7#include <Qt3DCore/qnode.h>
8#include <Qt3DRender/qt3drender_global.h>
9#include <Qt3DRender/QAbstractTexture>
10
11QT_BEGIN_NAMESPACE
12
13namespace Qt3DRender {
14
15class QAbstractTexture;
16class QRenderTargetOutputPrivate;
17
18class Q_3DRENDERSHARED_EXPORT QRenderTargetOutput : public Qt3DCore::QNode
19{
20 Q_OBJECT
21 Q_PROPERTY(AttachmentPoint attachmentPoint READ attachmentPoint WRITE setAttachmentPoint NOTIFY attachmentPointChanged)
22 Q_PROPERTY(QAbstractTexture *texture READ texture WRITE setTexture NOTIFY textureChanged)
23 Q_PROPERTY(int mipLevel READ mipLevel WRITE setMipLevel NOTIFY mipLevelChanged)
24 Q_PROPERTY(int layer READ layer WRITE setLayer NOTIFY layerChanged)
25 Q_PROPERTY(Qt3DRender::QAbstractTexture::CubeMapFace face READ face WRITE setFace NOTIFY faceChanged)
26
27public:
28 enum AttachmentPoint {
29 Color0 = 0,
30 Color1,
31 Color2,
32 Color3,
33 Color4,
34 Color5,
35 Color6,
36 Color7,
37 Color8,
38 Color9,
39 Color10,
40 Color11,
41 Color12,
42 Color13,
43 Color14,
44 Color15,
45 Depth,
46 Stencil,
47 DepthStencil
48 };
49 Q_ENUM(AttachmentPoint) // LCOV_EXCL_LINE
50
51 explicit QRenderTargetOutput(Qt3DCore::QNode *parent = nullptr);
52 ~QRenderTargetOutput();
53
54 AttachmentPoint attachmentPoint() const;
55 QAbstractTexture *texture() const;
56 int mipLevel() const;
57 int layer() const;
58 QAbstractTexture::CubeMapFace face() const;
59
60public Q_SLOTS:
61 void setAttachmentPoint(AttachmentPoint attachmentPoint);
62 void setTexture(QAbstractTexture *texture);
63 void setMipLevel(int level);
64 void setLayer(int layer);
65 void setFace(QAbstractTexture::CubeMapFace face);
66
67Q_SIGNALS:
68 void attachmentPointChanged(AttachmentPoint attachmentPoint);
69 void textureChanged(QAbstractTexture *texture);
70 void mipLevelChanged(int mipLevel);
71 void layerChanged(int layer);
72 void faceChanged(QAbstractTexture::CubeMapFace face);
73
74protected:
75 explicit QRenderTargetOutput(QRenderTargetOutputPrivate &dd, Qt3DCore::QNode *parent = nullptr);
76
77private:
78 Q_DECLARE_PRIVATE(QRenderTargetOutput)
79};
80
81} // namespace Qt3DRender
82
83QT_END_NAMESPACE
84
85Q_DECLARE_METATYPE(Qt3DRender::QRenderTargetOutput::AttachmentPoint) // LCOV_EXCL_LINE
86
87#endif // QT3DRENDER_QRENDERTARGETOUTPUT_H
88

source code of qt3d/src/render/frontend/qrendertargetoutput.h