Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qglxintegration.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
4#ifndef QGLXINTEGRATION_H
5#define QGLXINTEGRATION_H
6
7#include "qxcbwindow.h"
8#include "qxcbscreen.h"
9
10#include <qpa/qplatformopenglcontext.h>
11#include <qpa/qplatformoffscreensurface.h>
12#include <QtGui/QSurfaceFormat>
13
14#include <QtCore/QMutex>
15
16#include <GL/glx.h>
17
19
21 public QNativeInterface::QGLXContext
22{
23public:
25 QGLXContext(Display *display, GLXContext context, void *visualInfo, QPlatformOpenGLContext *share);
27
28 bool makeCurrent(QPlatformSurface *surface) override;
29 void doneCurrent() override;
30 void swapBuffers(QPlatformSurface *surface) override;
31 QFunctionPointer getProcAddress(const char *procName) override;
32
33 QSurfaceFormat format() const override;
34 bool isSharing() const override;
35 bool isValid() const override;
36
37 GLXContext nativeContext() const override { return glxContext(); }
38
39 GLXContext glxContext() const { return m_context; }
40 GLXFBConfig glxConfig() const { return m_config; }
41
42 static bool supportsThreading();
43 static void queryDummyContext();
44
45private:
46 Display *m_display = nullptr;
47 GLXFBConfig m_config = nullptr;
48 GLXContext m_context = nullptr;
49 GLXContext m_shareContext = nullptr;
50 QSurfaceFormat m_format;
51 bool m_isPBufferCurrent = false;
52 bool m_ownsContext = false;
53 GLenum (APIENTRY * m_getGraphicsResetStatus)() = nullptr;
54 bool m_lost = false;
55 static bool m_queriedDummyContext;
56 static bool m_supportsThreading;
57};
58
59
61{
62public:
65
66 QSurfaceFormat format() const override { return m_format; }
67 bool isValid() const override { return m_pbuffer != 0; }
68
69 GLXPbuffer pbuffer() const { return m_pbuffer; }
70
71private:
72 QXcbScreen *m_screen;
73 QSurfaceFormat m_format;
74 Display *m_display;
75 GLXPbuffer m_pbuffer;
76};
77
79
80#endif
bool makeCurrent(QPlatformSurface *surface) override
QSurfaceFormat format() const override
QGLXContext(Display *display, QXcbScreen *screen, const QSurfaceFormat &format, QPlatformOpenGLContext *share)
static bool supportsThreading()
bool isValid() const override
void swapBuffers(QPlatformSurface *surface) override
Reimplement in subclass to native swap buffers calls.
static void queryDummyContext()
void doneCurrent() override
GLXFBConfig glxConfig() const
bool isSharing() const override
GLXContext nativeContext() const override
GLXContext glxContext() const
QGLXPbuffer(QOffscreenSurface *offscreenSurface)
bool isValid() const override
Returns true if the platform offscreen surface has been allocated.
GLXPbuffer pbuffer() const
QSurfaceFormat format() const override
Returns the actual surface format of the offscreen surface.
\inmodule QtGui
QOffscreenSurface * offscreenSurface() const
The QPlatformOpenGLContext class provides an abstraction for native GL contexts.
QOpenGLContext * context() const
The QPlatformSurface class provides an abstraction for a surface.
The QSurfaceFormat class represents the format of a QSurface. \inmodule QtGui.
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
GLint GLsizei GLsizei GLenum format
#define APIENTRY
Definition qopenglext.h:51
const void * getProcAddress
QScreen * screen
[1]
Definition main.cpp:29
struct _XDisplay Display