src/video/uikit/SDL_uikitopenglview.m
changeset 7423 dfe7ad02f008
parent 7191 75360622e65f
child 7784 70b305e09b4e
equal deleted inserted replaced
7422:172b0c6e51d6 7423:dfe7ad02f008
    45       bBits:(int)bBits
    45       bBits:(int)bBits
    46       aBits:(int)aBits
    46       aBits:(int)aBits
    47       depthBits:(int)depthBits
    47       depthBits:(int)depthBits
    48       stencilBits:(int)stencilBits
    48       stencilBits:(int)stencilBits
    49       majorVersion:(int)majorVersion
    49       majorVersion:(int)majorVersion
       
    50       shareGroup:(EAGLSharegroup*)shareGroup
    50 {
    51 {
    51     depthBufferFormat = 0;
    52     depthBufferFormat = 0;
    52 
    53 
    53     if ((self = [super initWithFrame:frame])) {
    54     if ((self = [super initWithFrame:frame])) {
    54         const BOOL useStencilBuffer = (stencilBits != 0);
    55         const BOOL useStencilBuffer = (stencilBits != 0);
    69         eaglLayer.opaque = YES;
    70         eaglLayer.opaque = YES;
    70         eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
    71         eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
    71                                         [NSNumber numberWithBool: retained], kEAGLDrawablePropertyRetainedBacking, colorFormat, kEAGLDrawablePropertyColorFormat, nil];
    72                                         [NSNumber numberWithBool: retained], kEAGLDrawablePropertyRetainedBacking, colorFormat, kEAGLDrawablePropertyColorFormat, nil];
    72 
    73 
    73         if (majorVersion > 1) {
    74         if (majorVersion > 1) {
    74             context = [[EAGLContext alloc] initWithAPI: kEAGLRenderingAPIOpenGLES2];
    75             context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:shareGroup];
    75         } else {
    76         } else {
    76             context = [[EAGLContext alloc] initWithAPI: kEAGLRenderingAPIOpenGLES1];
    77             context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1 sharegroup:shareGroup];
    77         }
    78         }
    78         if (!context || ![EAGLContext setCurrentContext:context]) {
    79         if (!context || ![EAGLContext setCurrentContext:context]) {
    79             [self release];
    80             [self release];
    80             SDL_SetError("OpenGL ES %d not supported", majorVersion);
    81             SDL_SetError("OpenGL ES %d not supported", majorVersion);
    81             return nil;
    82             return nil;