src/video/quartz/SDL_QuartzGL.m
branchSDL-1.2
changeset 4204 976bc19f8f6b
parent 4188 9701c96e2cbb
child 4370 8d67936e32ec
equal deleted inserted replaced
4203:7e5486073044 4204:976bc19f8f6b
    39 #if (MAC_OS_X_VERSION_MAX_ALLOWED < 1020)
    39 #if (MAC_OS_X_VERSION_MAX_ALLOWED < 1020)
    40 #define NSOpenGLPFASampleBuffers ((NSOpenGLPixelFormatAttribute) 55)
    40 #define NSOpenGLPFASampleBuffers ((NSOpenGLPixelFormatAttribute) 55)
    41 #define NSOpenGLPFASamples ((NSOpenGLPixelFormatAttribute) 56)
    41 #define NSOpenGLPFASamples ((NSOpenGLPixelFormatAttribute) 56)
    42 #endif
    42 #endif
    43 
    43 
    44 
    44 #ifdef __powerpc__   /* we lost this in 10.6, which has no PPC support. */
    45 @implementation NSOpenGLContext (CGLContextAccess)
    45 @implementation NSOpenGLContext (CGLContextAccess)
    46 - (CGLContextObj) cglContext;
    46 - (CGLContextObj) cglContext;
    47 {
    47 {
    48     return _contextAuxiliary;
    48     return _contextAuxiliary;
    49 }
    49 }
    50 @end
    50 @end
       
    51 CGLContextObj QZ_GetCGLContextObj(NSOpenGLContext *nsctx)
       
    52 {
       
    53     return [nsctx cglContext];
       
    54 }
       
    55 #else
       
    56 CGLContextObj QZ_GetCGLContextObj(NSOpenGLContext *nsctx)
       
    57 {
       
    58     return (CGLContextObj) [nsctx CGLContextObj];
       
    59 }
       
    60 #endif
       
    61 
    51 
    62 
    52 /* OpenGL helper functions (used internally) */
    63 /* OpenGL helper functions (used internally) */
    53 
    64 
    54 int QZ_SetupOpenGL (_THIS, int bpp, Uint32 flags) {
    65 int QZ_SetupOpenGL (_THIS, int bpp, Uint32 flags) {
    55 
    66 
   163     #define GLI_SUBMIT_FUNC_CACHE_MAX 280
   174     #define GLI_SUBMIT_FUNC_CACHE_MAX 280
   164     #endif
   175     #endif
   165 
   176 
   166     {
   177     {
   167         long cache_max = 64;
   178         long cache_max = 64;
   168         CGLContextObj ctx = [ gl_context cglContext ];
   179         CGLContextObj ctx = QZ_GetCGLContextObj(gl_context);
   169         CGLSetParameter (ctx, GLI_SUBMIT_FUNC_CACHE_MAX, &cache_max);
   180         CGLSetParameter (ctx, GLI_SUBMIT_FUNC_CACHE_MAX, &cache_max);
   170         CGLSetParameter (ctx, GLI_ARRAY_FUNC_CACHE_MAX, &cache_max);
   181         CGLSetParameter (ctx, GLI_ARRAY_FUNC_CACHE_MAX, &cache_max);
   171     }
   182     }
   172 
   183 
   173     /* End Wisdom from Apple Engineer section. --ryan. */
   184     /* End Wisdom from Apple Engineer section. --ryan. */