diff options
Diffstat (limited to 'src/opengl/qglpixelbuffer_win.cpp')
-rw-r--r-- | src/opengl/qglpixelbuffer_win.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/opengl/qglpixelbuffer_win.cpp b/src/opengl/qglpixelbuffer_win.cpp index a986ccf..8d0d105 100644 --- a/src/opengl/qglpixelbuffer_win.cpp +++ b/src/opengl/qglpixelbuffer_win.cpp @@ -221,7 +221,7 @@ static void qt_format_to_attrib_list(bool has_render_texture, const QGLFormat &f } if ((f.redBufferSize() > 8 || f.greenBufferSize() > 8 || f.blueBufferSize() > 8 || f.alphaBufferSize() > 8) - && (QGLExtensions::glExtensions & QGLExtensions::NVFloatBuffer)) + && (QGLExtensions::glExtensions() & QGLExtensions::NVFloatBuffer)) { attribs[i++] = WGL_FLOAT_COMPONENTS_NV; attribs[i++] = TRUE; @@ -368,11 +368,9 @@ void QGLPixelBuffer::releaseFromDynamicTexture() bool QGLPixelBuffer::hasOpenGLPbuffers() { bool ret = false; - QGLWidget *dmy = 0; - if (!QGLContext::currentContext()) { - dmy = new QGLWidget; - dmy->makeCurrent(); - } + QGLTemporaryContext *tmpContext = 0; + if (!QGLContext::currentContext()) + tmpContext = new QGLTemporaryContext; PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC) wglGetProcAddress("wglGetExtensionsStringARB"); if (wglGetExtensionsStringARB) { @@ -382,8 +380,8 @@ bool QGLPixelBuffer::hasOpenGLPbuffers() ret = true; } } - if (dmy) - delete dmy; + if (tmpContext) + delete tmpContext; return ret; } |