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
11QT_BEGIN_NAMESPACE
12
13class QSurface;
14class QWindow;
15
16namespace Qt3DRender {
17
18class QRenderSurfaceSelectorPrivate;
19
20class 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
27public:
28 explicit QRenderSurfaceSelector(Qt3DCore::QNode *parent = nullptr);
29 ~QRenderSurfaceSelector();
30
31 QObject *surface() const;
32 QSize externalRenderTargetSize() const;
33 float surfacePixelRatio() const;
34
35public Q_SLOTS:
36 void setSurface(QObject *surfaceObject);
37 void setSurfacePixelRatio(float ratio);
38 void setExternalRenderTargetSize(const QSize &size);
39
40Q_SIGNALS:
41 void surfaceChanged(QObject *surface);
42 void externalRenderTargetSizeChanged(const QSize &size);
43 void surfacePixelRatioChanged(float ratio);
44
45protected:
46 Q_DECLARE_PRIVATE(QRenderSurfaceSelector)
47 explicit QRenderSurfaceSelector(QRenderSurfaceSelectorPrivate &dd, Qt3DCore::QNode *parent = nullptr);
48};
49
50} // namespace Qt3DRender
51
52QT_END_NAMESPACE
53
54#endif // QT3DRENDER_QRENDERSURFACESELECTOR_H
55

source code of qt3d/src/render/framegraph/qrendersurfaceselector.h