Cleanup context handling and IOS API

This commit is contained in:
2017-04-28 00:22:35 -07:00
parent 373af248d1
commit 3bb88c77bf
10 changed files with 267 additions and 24 deletions

View File

@@ -15,26 +15,29 @@ EAGLContext *gRenderContext = nil;
void KRContext::destroyDeviceContexts()
{
[gStreamerContext release];
[gRenderContext release];
}
void KRContext::createDeviceContexts()
{
gRenderContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
gStreamerContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup: gStreamerContext.sharegroup];
// FIXME: need to add code check for iOS 7 and also this appears to cause crashing
//gTextureStreamerContext.multiThreaded = TRUE;
if(!gRenderContext) {
gRenderContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
gStreamerContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup: gRenderContext.sharegroup];
// FIXME: need to add code check for iOS 7 and also this appears to cause crashing
//gTextureStreamerContext.multiThreaded = TRUE;
}
}
void KRContext::activateStreamerContext()
{
createDeviceContexts();
[EAGLContext setCurrentContext: gStreamerContext];
}
void KRContext::activateRenderContext()
{
createDeviceContexts();
[EAGLContext setCurrentContext: gRenderContext];
}