From 4a189c188ccd2fb5f8d1d5ddadf06cbd6bc0916f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 7 Jun 2011 17:25:22 +0200 Subject: QWindowContext / QWindowFormat refactor. To enable having a single GL context used for multiple drawables we need to de-couple the context class a bit more from the window class in the plugin API. Now contexts are created stand-alone based on a GL format and a share context, and when calling makeCurrent() a desired surface is specified. This maps well to GLX, EGL, Cocoa, AGL, and WGL, which all support this use case. QWindowContext is renamed to QGuiGLContext, and QWindowFormat is renamed to QGuiGLFormat. We have the ability to introduce a pbuffer or similar other offscreen GL drawable abstraction in the future. --- src/opengl/qgl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/opengl/qgl.cpp') diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index dc07a6f77d..fdcfeb1864 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1711,7 +1711,7 @@ void QGLContextPrivate::init(QPaintDevice *dev, const QGLFormat &format) vi = 0; #endif #if defined(Q_WS_QPA) - windowContext = 0; + guiGlContext = 0; #endif #if !defined(QT_NO_EGL) ownsEglContext = false; @@ -3330,7 +3330,7 @@ bool QGLContext::create(const QGLContext* shareContext) { Q_D(QGLContext); #ifdef Q_WS_QPA - if (!d->paintDevice && !d->windowContext) + if (!d->paintDevice && !d->guiGlContext) #else if (!d->paintDevice) #endif @@ -3420,8 +3420,8 @@ void QGLContext::setInitialized(bool on) const QGLContext* QGLContext::currentContext() { #ifdef Q_WS_QPA - if (const QWindowContext *threadContext = QWindowContext::currentContext()) { - return QGLContext::fromWindowContext(const_cast(threadContext)); + if (const QGuiGLContext *threadContext = QGuiGLContext::currentContext()) { + return QGLContext::fromGuiGLContext(const_cast(threadContext)); } return 0; #else -- cgit v1.2.3