Skip to content

Commit

Permalink
Attempted fix for change in EAGLContext API in Xcode 9.
Browse files Browse the repository at this point in the history
  • Loading branch information
BradLarson committed Jun 9, 2017
1 parent 6c74051 commit df42687
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions framework/Source/iOS/OpenGLContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,19 @@ public class OpenGLContext: SerialDispatch {
init() {
serialDispatchQueue.setSpecific(key:dispatchQueueKey, value:81)

guard let generatedContext = EAGLContext(api:.openGLES2, sharegroup:imageProcessingShareGroup) else {
let generatedContext:EAGLContext?
if let shareGroup = imageProcessingShareGroup {
generatedContext = EAGLContext(api:.openGLES2, sharegroup:shareGroup)
} else {
generatedContext = EAGLContext(api:.openGLES2)
}

guard let concreteGeneratedContext = generatedContext else {
fatalError("Unable to create an OpenGL ES 2.0 context. The GPUImage framework requires OpenGL ES 2.0 support to work.")
}

self.context = generatedContext
EAGLContext.setCurrent(generatedContext)
self.context = concreteGeneratedContext
EAGLContext.setCurrent(concreteGeneratedContext)

standardImageVBO = generateVBO(for:standardImageVertices)
generateTextureVBOs()
Expand Down

0 comments on commit df42687

Please sign in to comment.