diff options
author | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2015-12-10 17:45:26 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2015-12-10 22:29:47 +0000 |
commit | 2e8ff4ba1b7bff0b34d0492c5cb7758c445a6305 (patch) | |
tree | d35536cb5310a54f8e8cd1823a2175011284d214 /src/plugins/platforms/ios | |
parent | 824af4aac959d95402d70fb235433aafb20d5c43 (diff) |
Fix broken QIOSContext setup due to missing 0-initialization of EAGLContext
Change-Id: Ia4dbb2e3b055a7899c4a3e02698c5776ea7f73ea
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/ios')
-rw-r--r-- | src/plugins/platforms/ios/qioscontext.mm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/platforms/ios/qioscontext.mm b/src/plugins/platforms/ios/qioscontext.mm index cc42b6057e..8bdb4bcdb3 100644 --- a/src/plugins/platforms/ios/qioscontext.mm +++ b/src/plugins/platforms/ios/qioscontext.mm @@ -45,14 +45,15 @@ QIOSContext::QIOSContext(QOpenGLContext *context) : QPlatformOpenGLContext() , m_sharedContext(static_cast<QIOSContext *>(context->shareHandle())) + , m_eaglContext(0) , m_format(context->format()) { m_format.setRenderableType(QSurfaceFormat::OpenGLES); + EAGLSharegroup *shareGroup = m_sharedContext ? [m_sharedContext->m_eaglContext sharegroup] : nil; - for (int version = m_format.majorVersion() == 1 ? kEAGLRenderingAPIOpenGLES1 : kEAGLRenderingAPIOpenGLES3; - version >= m_format.majorVersion() && !m_eaglContext; --version) { + const int preferredVersion = m_format.majorVersion() == 1 ? kEAGLRenderingAPIOpenGLES1 : kEAGLRenderingAPIOpenGLES3; + for (int version = preferredVersion; !m_eaglContext && version >= m_format.majorVersion(); --version) m_eaglContext = [[EAGLContext alloc] initWithAPI:EAGLRenderingAPI(version) sharegroup:shareGroup]; - } if (m_eaglContext != nil) { EAGLContext *originalContext = [EAGLContext currentContext]; |