| 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 | |
| 11 | QT_BEGIN_NAMESPACE |
| 12 | |
| 13 | namespace Qt3DRender { |
| 14 | |
| 15 | class QAbstractTexture; |
| 16 | class QRenderTargetOutputPrivate; |
| 17 | |
| 18 | class 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 | |
| 27 | public: |
| 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 | Left, |
| 49 | Right |
| 50 | }; |
| 51 | Q_ENUM(AttachmentPoint) // LCOV_EXCL_LINE |
| 52 | |
| 53 | explicit QRenderTargetOutput(Qt3DCore::QNode *parent = nullptr); |
| 54 | ~QRenderTargetOutput(); |
| 55 | |
| 56 | AttachmentPoint attachmentPoint() const; |
| 57 | QAbstractTexture *texture() const; |
| 58 | int mipLevel() const; |
| 59 | int layer() const; |
| 60 | QAbstractTexture::CubeMapFace face() const; |
| 61 | |
| 62 | public Q_SLOTS: |
| 63 | void setAttachmentPoint(AttachmentPoint attachmentPoint); |
| 64 | void setTexture(QAbstractTexture *texture); |
| 65 | void setMipLevel(int level); |
| 66 | void setLayer(int layer); |
| 67 | void setFace(QAbstractTexture::CubeMapFace face); |
| 68 | |
| 69 | Q_SIGNALS: |
| 70 | void attachmentPointChanged(AttachmentPoint attachmentPoint); |
| 71 | void textureChanged(QAbstractTexture *texture); |
| 72 | void mipLevelChanged(int mipLevel); |
| 73 | void layerChanged(int layer); |
| 74 | void faceChanged(QAbstractTexture::CubeMapFace face); |
| 75 | |
| 76 | protected: |
| 77 | explicit QRenderTargetOutput(QRenderTargetOutputPrivate &dd, Qt3DCore::QNode *parent = nullptr); |
| 78 | |
| 79 | private: |
| 80 | Q_DECLARE_PRIVATE(QRenderTargetOutput) |
| 81 | }; |
| 82 | |
| 83 | } // namespace Qt3DRender |
| 84 | |
| 85 | QT_END_NAMESPACE |
| 86 | |
| 87 | Q_DECLARE_METATYPE(Qt3DRender::QRenderTargetOutput::AttachmentPoint) // LCOV_EXCL_LINE |
| 88 | |
| 89 | #endif // QT3DRENDER_QRENDERTARGETOUTPUT_H |
| 90 | |