blob: c1ae57fe8595d7b80ff898e0e904d80b5ee2244d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
// Copyright (C) 2014 BogDan Vatra <bogdan@kde.org>
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QANDROIDPLATFORMOPENGLWINDOW_H
#define QANDROIDPLATFORMOPENGLWINDOW_H
#include "qandroidplatformwindow.h"
#include <QWaitCondition>
#include <QtCore/qjnienvironment.h>
#include <QtCore/qjniobject.h>
#include <EGL/egl.h>
QT_BEGIN_NAMESPACE
class QAndroidPlatformOpenGLWindow : public QAndroidPlatformWindow
{
public:
explicit QAndroidPlatformOpenGLWindow(QWindow *window, EGLDisplay display);
~QAndroidPlatformOpenGLWindow();
void setGeometry(const QRect &rect) override;
EGLSurface eglSurface(EGLConfig config);
QSurfaceFormat format() const override;
bool checkNativeSurface(EGLConfig config);
void applicationStateChanged(Qt::ApplicationState) override;
protected:
void createEgl(EGLConfig config);
void clearEgl();
private:
EGLDisplay m_eglDisplay = EGL_NO_DISPLAY;
EGLSurface m_eglSurface = EGL_NO_SURFACE;
EGLNativeWindowType m_nativeWindow = nullptr;
QSurfaceFormat m_format;
QRect m_oldGeometry;
};
QT_END_NAMESPACE
#endif // QANDROIDPLATFORMOPENGLWINDOW_H
|