diff options
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 4 | ||||
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 1c4ba7a..413942d 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -568,6 +568,7 @@ void QGL2PaintEngineEx::beginNativePainting() #ifndef QT_OPENGL_ES_2 const QGLFormat &fmt = d->device->format(); if (fmt.majorVersion() < 3 || (fmt.majorVersion() == 3 && fmt.minorVersion() < 1) + || (fmt.majorVersion() == 3 && fmt.minorVersion() == 1 && d->hasCompatibilityExtension) || fmt.profile() == QGLFormat::CompatibilityProfile) { // be nice to people who mix OpenGL 1.x code with QPainter commands @@ -2139,6 +2140,9 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) d->device->beginPaint(); #if !defined(QT_OPENGL_ES_2) + QGLExtensionMatcher extensions; + d->hasCompatibilityExtension = extensions.match("GL_ARB_compatibility"); + bool success = qt_resolve_version_2_0_functions(d->ctx) && qt_resolve_buffer_extensions(d->ctx) && (!QGLFramebufferObject::hasOpenGLFramebufferObjects() diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index f3c0683..7e00be5 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -187,7 +187,8 @@ public: snapToPixelGrid(false), nativePaintingActive(false), inverseScale(1), - lastMaskTextureUsed(0) + lastMaskTextureUsed(0), + hasCompatibilityExtension(false) { } ~QGL2PaintEngineExPrivate(); @@ -318,6 +319,8 @@ public: QVector<GLuint> unusedIBOSToClean; const GLfloat *vertexAttribPointers[3]; + + bool hasCompatibilityExtension; }; |