Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qioscontext.h
Go to the documentation of this file.
1// Copyright (C) 2016 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// Qt-Security score:significant reason:default
4
5#ifndef QIOSCONTEXT_H
6#define QIOSCONTEXT_H
7
8#include <QtCore/qloggingcategory.h>
9#include <qpa/qplatformopenglcontext.h>
10
11@class EAGLContext;
12
13QT_BEGIN_NAMESPACE
14
15class QIOSWindow;
16
18{
20
21public:
23 ~QIOSContext();
24
25 QSurfaceFormat format() const override;
26
27 void swapBuffers(QPlatformSurface *surface) override;
28
29 bool makeCurrent(QPlatformSurface *surface) override;
30 void doneCurrent() override;
31
32 GLuint defaultFramebufferObject(QPlatformSurface *) const override;
33 QFunctionPointer getProcAddress(const char *procName) override;
34
35 bool isSharing() const override;
36 bool isValid() const override;
37
38private Q_SLOTS:
40
41private:
42 QIOSContext *m_sharedContext;
43 EAGLContext *m_eaglContext;
44 QSurfaceFormat m_format;
45
46 struct FramebufferObject {
47 GLuint handle;
48 GLuint colorRenderbuffer;
49 GLuint depthRenderbuffer;
50 GLint renderbufferWidth;
51 GLint renderbufferHeight;
52 bool isComplete;
53 };
54
55 static bool verifyGraphicsHardwareAvailability();
56 static void deleteBuffers(const FramebufferObject &framebufferObject);
57
58 FramebufferObject &backingFramebufferObjectFor(QPlatformSurface *) const;
59 mutable QHash<QPlatformSurface *, FramebufferObject> m_framebufferObjects;
60
61 bool needsRenderbufferResize(QPlatformSurface *) const;
62};
63
64QT_END_NAMESPACE
65
66#endif // QIOSCONTEXT_H
QSurfaceFormat format() const override
void doneCurrent() override
bool isSharing() const override
void swapBuffers(QPlatformSurface *surface) override
Reimplement in subclass to native swap buffers calls.
GLuint defaultFramebufferObject(QPlatformSurface *) const override
Reimplement in subclass if your platform uses framebuffer objects for surfaces.
bool isValid() const override
QFunctionPointer getProcAddress(const char *procName) override
Reimplement in subclass to allow dynamic querying of OpenGL symbols.
bool makeCurrent(QPlatformSurface *surface) override
static QIOSIntegration * instance()
Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher")
#define Q_ASSERT_IS_GL_SURFACE(surface)
#define QT_IOS_GL_STATUS_CASE(val)
static QString fboStatusString(GLenum status)