1 | // Copyright (C) 2016 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_QRENDERSURFACESELECTOR_H |
5 | #define QT3DRENDER_QRENDERSURFACESELECTOR_H |
6 | |
7 | #include <Qt3DRender/qframegraphnode.h> |
8 | #include <Qt3DRender/qt3drender_global.h> |
9 | #include <QtCore/QSize> |
10 | |
11 | QT_BEGIN_NAMESPACE |
12 | |
13 | class QSurface; |
14 | class QWindow; |
15 | |
16 | namespace Qt3DRender { |
17 | |
18 | class QRenderSurfaceSelectorPrivate; |
19 | |
20 | class Q_3DRENDERSHARED_EXPORT QRenderSurfaceSelector : public Qt3DRender::QFrameGraphNode |
21 | { |
22 | Q_OBJECT |
23 | Q_PROPERTY(QObject *surface READ surface WRITE setSurface NOTIFY surfaceChanged) |
24 | Q_PROPERTY(QSize externalRenderTargetSize READ externalRenderTargetSize WRITE setExternalRenderTargetSize NOTIFY externalRenderTargetSizeChanged) |
25 | Q_PROPERTY(float surfacePixelRatio READ surfacePixelRatio WRITE setSurfacePixelRatio NOTIFY surfacePixelRatioChanged) |
26 | |
27 | public: |
28 | explicit QRenderSurfaceSelector(Qt3DCore::QNode *parent = nullptr); |
29 | ~QRenderSurfaceSelector(); |
30 | |
31 | QObject *surface() const; |
32 | QSize externalRenderTargetSize() const; |
33 | float surfacePixelRatio() const; |
34 | |
35 | public Q_SLOTS: |
36 | void setSurface(QObject *surfaceObject); |
37 | void setSurfacePixelRatio(float ratio); |
38 | void setExternalRenderTargetSize(const QSize &size); |
39 | |
40 | Q_SIGNALS: |
41 | void surfaceChanged(QObject *surface); |
42 | void externalRenderTargetSizeChanged(const QSize &size); |
43 | void surfacePixelRatioChanged(float ratio); |
44 | |
45 | protected: |
46 | Q_DECLARE_PRIVATE(QRenderSurfaceSelector) |
47 | explicit QRenderSurfaceSelector(QRenderSurfaceSelectorPrivate &dd, Qt3DCore::QNode *parent = nullptr); |
48 | }; |
49 | |
50 | } // namespace Qt3DRender |
51 | |
52 | QT_END_NAMESPACE |
53 | |
54 | #endif // QT3DRENDER_QRENDERSURFACESELECTOR_H |
55 | |