From 4b2f35d04ca3c2e037b4d0edd8b2350051cc572c Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 28 Feb 2014 17:03:57 +0100 Subject: Dynamic GL: remove exporting symbols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the opengl proxy for now. Later it will either be moved into a separate library or replaced by a QOpenGLFunctions-based approach. This means that the -opengl dynamic configuration is not usable for the time being. The rest of the enablers remain in place. The convenience function QOpenGLFunctions::isES() is now moved to QOpenGLContext and is changed to check the renderable type. This is extremely useful since besides supporting dynamic GL it solves also the problem of GL_ARB_ES2_compatibility (i.e. it triggers the real ES path when creating an ES-compatible context with a desktop OpenGL implementation). Task-number: QTBUG-36483 Task-number: QTBUG-37172 Change-Id: I045be3fc16e9043e1528cf48e6bf0903da4fa7ca Reviewed-by: Friedemann Kleint Reviewed-by: Jørgen Lind --- src/gui/opengl/qopenglframebufferobject_p.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/gui/opengl/qopenglframebufferobject_p.h') diff --git a/src/gui/opengl/qopenglframebufferobject_p.h b/src/gui/opengl/qopenglframebufferobject_p.h index f0e07f2119..bd830b38e9 100644 --- a/src/gui/opengl/qopenglframebufferobject_p.h +++ b/src/gui/opengl/qopenglframebufferobject_p.h @@ -70,7 +70,12 @@ public: mipmap(false) { #ifndef QT_OPENGL_ES_2 - internal_format = QOpenGLFunctions::isES() ? GL_RGBA : GL_RGBA8; + // There is nothing that says QOpenGLFramebufferObjectFormat needs a current + // context, so we need a fallback just to be safe, even though in pratice there + // will usually be a context current. + QOpenGLContext *ctx = QOpenGLContext::currentContext(); + const bool isES = ctx ? ctx->isES() : QOpenGLContext::openGLModuleType() != QOpenGLContext::DesktopGL; + internal_format = isES ? GL_RGBA : GL_RGBA8; #else internal_format = GL_RGBA; #endif -- cgit v1.2.3