diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-06-07 17:25:22 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-06-10 09:24:56 +0200 |
commit | 4a189c188ccd2fb5f8d1d5ddadf06cbd6bc0916f (patch) | |
tree | 99bff9f015e869b5521836ea5667590939b22a53 /src/opengl/qgl.cpp | |
parent | 4d10e64f2a78e32418a98e1c80c6579ae0779dfc (diff) |
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.
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r-- | src/opengl/qgl.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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<QWindowContext *>(threadContext)); + if (const QGuiGLContext *threadContext = QGuiGLContext::currentContext()) { + return QGLContext::fromGuiGLContext(const_cast<QGuiGLContext *>(threadContext)); } return 0; #else |