From af1e32426c50694c0e4c1c292aa5eeee3b38c7bc Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 17 Mar 2014 10:35:35 +0100 Subject: Add public and QPA APIs for adapting existing OpenGL contexts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For now only xcb on GLX is supported. Other platforms will follow later. Add also some missing documentation for the platform OpenGL context factory functions. [ChangeLog] QOpenGLContext is now able to adopt existing native contexts. Task-number: QTBUG-37552 Change-Id: I5dd959f102df178f646b2df5989203b5dc6de376 Reviewed-by: Jørgen Lind --- src/plugins/platforms/xcb/qglxintegration.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/xcb/qglxintegration.h') diff --git a/src/plugins/platforms/xcb/qglxintegration.h b/src/plugins/platforms/xcb/qglxintegration.h index 00bba94ab3..a7787f5f86 100644 --- a/src/plugins/platforms/xcb/qglxintegration.h +++ b/src/plugins/platforms/xcb/qglxintegration.h @@ -58,7 +58,8 @@ QT_BEGIN_NAMESPACE class QGLXContext : public QPlatformOpenGLContext { public: - QGLXContext(QXcbScreen *xd, const QSurfaceFormat &format, QPlatformOpenGLContext *share); + QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlatformOpenGLContext *share, + const QVariant &nativeHandle); ~QGLXContext(); bool makeCurrent(QPlatformSurface *surface); @@ -72,16 +73,22 @@ public: GLXContext glxContext() const { return m_context; } + QVariant nativeHandle() const; + static bool supportsThreading(); static void queryDummyContext(); private: + void init(QXcbScreen *screen, QPlatformOpenGLContext *share); + void init(QXcbScreen *screen, QPlatformOpenGLContext *share, const QVariant &nativeHandle); + QXcbScreen *m_screen; GLXContext m_context; GLXContext m_shareContext; QSurfaceFormat m_format; bool m_isPBufferCurrent; int m_swapInterval; + bool m_ownsContext; static bool m_queriedDummyContext; static bool m_supportsThreading; }; -- cgit v1.2.3