| 1 |
// Copyright (C) 2018 The Qt Company Ltd. |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 |
|
| 4 |
#ifndef WINDOW_H |
| 5 |
#define WINDOW_H |
| 6 |
|
| 7 |
#include <QWindow> |
| 8 |
|
| 9 |
enum GraphicsApi |
| 10 |
{ |
| 11 |
OpenGL, |
| 12 |
Vulkan, |
| 13 |
D3D11, |
| 14 |
D3D12, |
| 15 |
Metal |
| 16 |
}; |
| 17 |
|
| 18 |
class Window : public QWindow |
| 19 |
{ |
| 20 |
Q_OBJECT |
| 21 |
|
| 22 |
public: |
| 23 |
Window(const QString &title, GraphicsApi api); |
| 24 |
~Window(); |
| 25 |
|
| 26 |
void exposeEvent(QExposeEvent *) override; |
| 27 |
bool event(QEvent *) override; |
| 28 |
|
| 29 |
signals: |
| 30 |
void initRequested(); |
| 31 |
void renderRequested(bool newlyExposed); |
| 32 |
void surfaceGoingAway(); |
| 33 |
void syncSurfaceSizeRequested(); |
| 34 |
|
| 35 |
protected: |
| 36 |
bool m_running = false; |
| 37 |
bool m_notExposed = true; |
| 38 |
}; |
| 39 |
|
| 40 |
#endif |