10#include <qpa/qplatformopenglcontext.h>
11#include <qpa/qplatformoffscreensurface.h>
12#include <QtGui/QSurfaceFormat>
14#include <QtCore/QMutex>
20class QGLXContext :
public QPlatformOpenGLContext,
21 public QNativeInterface::QGLXContext
24 QGLXContext(Display *display, QXcbScreen *screen,
const QSurfaceFormat &format, QPlatformOpenGLContext *share);
25 QGLXContext(Display *display, GLXContext context,
void *visualInfo, QPlatformOpenGLContext *share);
28 bool makeCurrent(QPlatformSurface *surface) override;
29 void doneCurrent() override;
30 void swapBuffers(QPlatformSurface *surface) override;
31 QFunctionPointer getProcAddress(
const char *procName) override;
33 QSurfaceFormat format()
const override;
34 bool isSharing()
const override;
35 bool isValid()
const override;
37 GLXContext nativeContext()
const override {
return glxContext(); }
39 GLXContext glxContext()
const {
return m_context; }
40 GLXFBConfig glxConfig()
const {
return m_config; }
42 static bool supportsThreading();
43 static void queryDummyContext();
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;
55 static bool m_queriedDummyContext;
56 static bool m_supportsThreading;
63 explicit QGLXPbuffer(QOffscreenSurface *offscreenSurface);
69 GLXPbuffer
pbuffer()
const {
return m_pbuffer; }
73 QSurfaceFormat m_format;
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.
#define GL_CONTEXT_PROFILE_MASK
#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT
#define GL_CONTEXT_CORE_PROFILE_BIT
#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT
#define GL_CONTEXT_FLAG_DEBUG_BIT
static Window createDummyWindow(Display *dpy, GLXFBConfig config, int screenNumber, Window rootWin)
#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB
static const char * qglx_threadedgl_blacklist_renderer[]
static Window createDummyWindow(Display *dpy, XVisualInfo *visualInfo, int screenNumber, Window rootWin)
static const char * qglx_threadedgl_blacklist_vendor[]
#define GLX_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV
static void updateFormatFromContext(QSurfaceFormat &format)
static QByteArray getGlString(GLenum param)
static bool hasGlExtension(const QSurfaceFormat &format, const char *ext)
#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB
static QXcbScreen * screenForPlatformSurface(QPlatformSurface *surface)
#define GLX_CONTEXT_PROFILE_MASK_ARB
#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB
#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB
#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT
#define GLX_LOSE_CONTEXT_ON_RESET_ARB
#define GL_RESET_NOTIFICATION_STRATEGY_ARB
#define GL_LOSE_CONTEXT_ON_RESET_ARB
#define GL_NUM_EXTENSIONS