LoginSignup
1
0

More than 5 years have passed since last update.

iOSで複数のコンテキスト間でOpenGL ESオブジェクトを共有する

Last updated at Posted at 2015-06-18
// コンテクストのリソースを取得する
- (void)initOpenGL {

    if ([EAGLContext currentContext]==nil) {
        context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
    }
    else{
        context = [[EAGLContext alloc] initWithAPI:[[EAGLContext currentContext] API] sharegroup: [[EAGLContext currentContext] sharegroup]];
    }
    if (!context || ![EAGLContext setCurrentContext:context]) {
        return;
    }

    // ... (略)

}

Reference:
https://developer.apple.com/library/ios/qa/qa1612/_index.html
https://developer.apple.com/library/ios/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/WorkingwithOpenGLESContexts/WorkingwithOpenGLESContexts.html
https://developer.apple.com/jp/documentation/OpenGLES_ProgrammingGuide.pdf

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0