src/video/uikit/SDL_uikitopenglview.m
branchiOS-improvements
changeset 9501 574db299498f
parent 9500 cbf5c5ecf5ac
child 9502 933ed557b7c1
equal deleted inserted replaced
9500:cbf5c5ecf5ac 9501:574db299498f
    26 #include <OpenGLES/EAGLDrawable.h>
    26 #include <OpenGLES/EAGLDrawable.h>
    27 #include "SDL_uikitopenglview.h"
    27 #include "SDL_uikitopenglview.h"
    28 #include "SDL_uikitmessagebox.h"
    28 #include "SDL_uikitmessagebox.h"
    29 
    29 
    30 
    30 
    31 @implementation SDL_uikitopenglview
    31 @implementation SDL_uikitopenglview {
       
    32 
       
    33     /* OpenGL names for the renderbuffer and framebuffers used to render to this view */
       
    34     GLuint viewRenderbuffer, viewFramebuffer;
       
    35 
       
    36     /* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */
       
    37     GLuint depthRenderbuffer;
       
    38 
       
    39     /* format of depthRenderbuffer */
       
    40     GLenum depthBufferFormat;
       
    41 
       
    42     id displayLink;
       
    43     int animationInterval;
       
    44     void (*animationCallback)(void*);
       
    45     void *animationCallbackParam;
       
    46 
       
    47 }
    32 
    48 
    33 @synthesize context;
    49 @synthesize context;
    34 
    50 
    35 @synthesize backingWidth = backingWidth;
    51 @synthesize backingWidth;
    36 @synthesize backingHeight = backingHeight;
    52 @synthesize backingHeight;
    37 
    53 
    38 + (Class)layerClass
    54 + (Class)layerClass
    39 {
    55 {
    40     return [CAEAGLLayer class];
    56     return [CAEAGLLayer class];
    41 }
    57 }
    51         stencilBits:(int)stencilBits
    67         stencilBits:(int)stencilBits
    52                sRGB:(BOOL)sRGB
    68                sRGB:(BOOL)sRGB
    53        majorVersion:(int)majorVersion
    69        majorVersion:(int)majorVersion
    54          shareGroup:(EAGLSharegroup*)shareGroup
    70          shareGroup:(EAGLSharegroup*)shareGroup
    55 {
    71 {
    56     depthBufferFormat = 0;
       
    57 
       
    58     if ((self = [super initWithFrame:frame])) {
    72     if ((self = [super initWithFrame:frame])) {
    59         const BOOL useStencilBuffer = (stencilBits != 0);
    73         const BOOL useStencilBuffer = (stencilBits != 0);
    60         const BOOL useDepthBuffer = (depthBits != 0);
    74         const BOOL useDepthBuffer = (depthBits != 0);
    61         NSString *colorFormat = nil;
    75         NSString *colorFormat = nil;
    62 
    76