| 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 QT3DWINDOW_H |
| 5 | #define QT3DWINDOW_H |
| 6 | |
| 7 | #include <Qt3DExtras/qt3dextras_global.h> |
| 8 | #include <Qt3DRender/qrenderapi.h> |
| 9 | #include <QtGui/QWindow> |
| 10 | |
| 11 | QT_BEGIN_NAMESPACE |
| 12 | |
| 13 | namespace Qt3DCore { |
| 14 | class QAspectEngine; |
| 15 | class QAbstractAspect; |
| 16 | class QEntity; |
| 17 | } |
| 18 | |
| 19 | namespace Qt3DRender { |
| 20 | class QCamera; |
| 21 | class QFrameGraphNode; |
| 22 | class QRenderAspect; |
| 23 | class QRenderSettings; |
| 24 | } |
| 25 | |
| 26 | namespace Qt3DExtras { |
| 27 | class QForwardRenderer; |
| 28 | } |
| 29 | |
| 30 | namespace Qt3DInput { |
| 31 | class QInputAspect; |
| 32 | class QInputSettings; |
| 33 | } |
| 34 | |
| 35 | namespace Qt3DLogic { |
| 36 | class QLogicAspect; |
| 37 | } |
| 38 | |
| 39 | namespace Qt3DExtras { |
| 40 | |
| 41 | class Qt3DWindowPrivate; |
| 42 | |
| 43 | class Q_3DEXTRASSHARED_EXPORT Qt3DWindow : public QWindow |
| 44 | { |
| 45 | Q_OBJECT |
| 46 | public: |
| 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 | |
| 62 | public Q_SLOTS: |
| 63 | |
| 64 | Q_SIGNALS: |
| 65 | |
| 66 | protected: |
| 67 | void showEvent(QShowEvent *e) override; |
| 68 | void resizeEvent(QResizeEvent *) override; |
| 69 | bool event(QEvent *e) override; |
| 70 | |
| 71 | private: |
| 72 | Q_DECLARE_PRIVATE(Qt3DWindow) |
| 73 | }; |
| 74 | |
| 75 | Q_3DEXTRASSHARED_EXPORT |
| 76 | void setupWindowSurface(QWindow* window, Qt3DRender::API) noexcept; |
| 77 | |
| 78 | } // Qt3DExtras |
| 79 | |
| 80 | QT_END_NAMESPACE |
| 81 | |
| 82 | #endif // QT3DWINDOW_H |
| 83 |
