Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qandroidplatformvulkanwindow.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
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 QANDROIDPLATFORMVULKANWINDOW_H
5#define QANDROIDPLATFORMVULKANWINDOW_H
6
7#if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_ANDROID_KHR)
8#error "vulkan.h included without Android WSI"
9#endif
10
11#define VK_USE_PLATFORM_ANDROID_KHR
12
16
17#include <QWaitCondition>
18#include <QtCore/QJniEnvironment>
19#include <QtCore/QJniObject>
20
22
24{
25public:
28
29 void setGeometry(const QRect &rect) override;
30 QSurfaceFormat format() const override;
32
33 VkSurfaceKHR *vkSurface();
34
35protected:
36 void surfaceChanged(JNIEnv *jniEnv, jobject surface, int w, int h) override;
37
38private:
39 void sendExpose();
40 void clearSurface();
41
42 int m_nativeSurfaceId;
43 ANativeWindow *m_nativeWindow;
44 QJniObject m_androidSurfaceObject;
45 QWaitCondition m_surfaceWaitCondition;
46 QSurfaceFormat m_format;
47 QRect m_oldGeometry;
48 VkSurfaceKHR m_vkSurface;
49 PFN_vkCreateAndroidSurfaceKHR m_createVkSurface;
50 PFN_vkDestroySurfaceKHR m_destroyVkSurface;
51};
52
54
55#endif // QANDROIDPLATFORMVULKANWINDOW_H
void surfaceChanged(JNIEnv *jniEnv, jobject surface, int w, int h) override
void applicationStateChanged(Qt::ApplicationState) override
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
QSurfaceFormat format() const override
Returns the actual surface format of the window.
\inmodule QtCore
QSurface * surface() const
QWindow * window() const
Returns the window which belongs to the QPlatformWindow.
\inmodule QtCore\reentrant
Definition qrect.h:30
The QSurfaceFormat class represents the format of a QSurface. \inmodule QtGui.
\inmodule QtGui
Definition qwindow.h:63
rect
[4]
Combined button and popup list for selecting options.
ApplicationState
Definition qnamespace.h:261
GLfloat GLfloat GLfloat w
[0]
GLfloat GLfloat GLfloat GLfloat h