1// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#ifndef QT3DWINDOW_H
5#define QT3DWINDOW_H
6
7#include <Qt3DExtras/qt3dextras_global.h>
8#include <Qt3DRender/qrenderapi.h>
9#include <QtGui/QWindow>
10
11QT_BEGIN_NAMESPACE
12
13namespace Qt3DCore {
14class QAspectEngine;
15class QAbstractAspect;
16class QEntity;
17}
18
19namespace Qt3DRender {
20class QCamera;
21class QFrameGraphNode;
22class QRenderAspect;
23class QRenderSettings;
24}
25
26namespace Qt3DExtras {
27class QForwardRenderer;
28}
29
30namespace Qt3DInput {
31class QInputAspect;
32class QInputSettings;
33}
34
35namespace Qt3DLogic {
36class QLogicAspect;
37}
38
39namespace Qt3DExtras {
40
41class Qt3DWindowPrivate;
42
43class Q_3DEXTRASSHARED_EXPORT Qt3DWindow : public QWindow
44{
45 Q_OBJECT
46public:
47 Qt3DWindow(QScreen *screen = nullptr, Qt3DRender::API = Qt3DRender::API::RHI);
48 ~Qt3DWindow();
49
50 void registerAspect(Qt3DCore::QAbstractAspect *aspect);
51 void registerAspect(const QString &name);
52
53 void setRootEntity(Qt3DCore::QEntity *root);
54
55 void setActiveFrameGraph(Qt3DRender::QFrameGraphNode *activeFrameGraph);
56 Qt3DRender::QFrameGraphNode *activeFrameGraph() const;
57 Qt3DExtras::QForwardRenderer *defaultFrameGraph() const;
58
59 Qt3DRender::QCamera *camera() const;
60 Qt3DRender::QRenderSettings *renderSettings() const;
61
62public Q_SLOTS:
63
64Q_SIGNALS:
65
66protected:
67 void showEvent(QShowEvent *e) override;
68 void resizeEvent(QResizeEvent *) override;
69 bool event(QEvent *e) override;
70
71private:
72 Q_DECLARE_PRIVATE(Qt3DWindow)
73};
74
75Q_3DEXTRASSHARED_EXPORT
76void setupWindowSurface(QWindow* window, Qt3DRender::API) noexcept;
77
78} // Qt3DExtras
79
80QT_END_NAMESPACE
81
82#endif // QT3DWINDOW_H
83

source code of qt3d/src/extras/defaults/qt3dwindow.h