1 | // Copyright (C) 2018 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_QWAITFENCE_H |
5 | #define QT3DRENDER_QWAITFENCE_H |
6 | |
7 | #include <Qt3DRender/QFrameGraphNode> |
8 | #include <QtCore/QVariant> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | namespace Qt3DRender { |
13 | |
14 | class QWaitFencePrivate; |
15 | |
16 | class Q_3DRENDERSHARED_EXPORT QWaitFence : public QFrameGraphNode |
17 | { |
18 | Q_OBJECT |
19 | Q_PROPERTY(HandleType handleType READ handleType WRITE setHandleType NOTIFY handleTypeChanged) |
20 | Q_PROPERTY(QVariant handle READ handle WRITE setHandle NOTIFY handleChanged) |
21 | Q_PROPERTY(bool waitOnCPU READ waitOnCPU WRITE setWaitOnCPU NOTIFY waitOnCPUChanged) |
22 | Q_PROPERTY(quint64 timeout READ timeout WRITE setTimeout NOTIFY timeoutChanged) |
23 | |
24 | public: |
25 | enum HandleType { |
26 | NoHandle, |
27 | OpenGLFenceId |
28 | }; |
29 | Q_ENUM(HandleType) // LCOV_EXCL_LINE |
30 | explicit QWaitFence(Qt3DCore::QNode *parent = nullptr); |
31 | ~QWaitFence(); |
32 | |
33 | void setHandleType(HandleType type); |
34 | void setHandle(QVariant handle); |
35 | |
36 | HandleType handleType() const; |
37 | QVariant handle() const; |
38 | |
39 | bool waitOnCPU() const; |
40 | void setWaitOnCPU(bool waitOnCPU); |
41 | |
42 | quint64 timeout() const; |
43 | void setTimeout(quint64 timeout); |
44 | |
45 | Q_SIGNALS: |
46 | void waitOnCPUChanged(bool waitOnCPU); |
47 | void timeoutChanged(quint64 timeoutChanged); |
48 | void handleTypeChanged(HandleType handleType); |
49 | void handleChanged(QVariant handle); |
50 | |
51 | protected: |
52 | explicit QWaitFence(QWaitFencePrivate &dd, Qt3DCore::QNode *parent = nullptr); |
53 | |
54 | private: |
55 | Q_DECLARE_PRIVATE(QWaitFence) |
56 | }; |
57 | |
58 | } // Qt3DRender |
59 | |
60 | QT_END_NAMESPACE |
61 | |
62 | #endif // QT3DRENDER_QWAITFENCE_H |
63 | |