src/video/quartz/SDL_QuartzGL.m
changeset 857 ce05e92d909b
parent 770 ac44ddb84f6f
child 890 416158ec61a0
equal deleted inserted replaced
856:d3165b90ee42 857:ce05e92d909b
    20     slouken@libsdl.org
    20     slouken@libsdl.org
    21 */
    21 */
    22 
    22 
    23 #include "SDL_QuartzVideo.h"
    23 #include "SDL_QuartzVideo.h"
    24 
    24 
       
    25 /*
       
    26  * GL_ARB_Multisample is supposed to be available in 10.1, according to Apple:
       
    27  *
       
    28  *   http://developer.apple.com/opengl/extensions.html#GL_ARB_multisample
       
    29  *
       
    30  *  ...but it isn't in the system headers, according to Sam:
       
    31  *
       
    32  *   http://www.libsdl.org/pipermail/sdl/2003-December/058335.html
       
    33  *
       
    34  * These are normally enums and not #defines in the system headers.
       
    35  *
       
    36  *   --ryan.
       
    37  */
       
    38 #if (MAC_OS_X_VERSION_MAX_ALLOWED < 1020)
       
    39 #define NSOpenGLPFASampleBuffers ((NSOpenGLPixelFormatAttribute) 55)
       
    40 #define NSOpenGLPFASamples ((NSOpenGLPixelFormatAttribute) 56)
       
    41 #endif
       
    42 
    25 
    43 
    26 @implementation NSOpenGLContext (CGLContextAccess)
    44 @implementation NSOpenGLContext (CGLContextAccess)
    27 - (CGLContextObj) cglContext;
    45 - (CGLContextObj) cglContext;
    28 {
    46 {
    29     return _contextAuxiliary;
    47     return _contextAuxiliary;
    66     if ( this->gl_config.stencil_size != 0 ) {
    84     if ( this->gl_config.stencil_size != 0 ) {
    67         attr[i++] = NSOpenGLPFAStencilSize;
    85         attr[i++] = NSOpenGLPFAStencilSize;
    68         attr[i++] = this->gl_config.stencil_size;
    86         attr[i++] = this->gl_config.stencil_size;
    69     }
    87     }
    70 
    88 
    71 #if NSOPENGL_CURRENT_VERSION > 1  /* What version should this be? */
       
    72     if ( this->gl_config.multisamplebuffers != 0 ) {
    89     if ( this->gl_config.multisamplebuffers != 0 ) {
    73         attr[i++] = NSOpenGLPFASampleBuffers;
    90         attr[i++] = NSOpenGLPFASampleBuffers;
    74         attr[i++] = this->gl_config.multisamplebuffers;
    91         attr[i++] = this->gl_config.multisamplebuffers;
    75     }
    92     }
    76 
    93 
    77     if ( this->gl_config.multisamplesamples != 0 ) {
    94     if ( this->gl_config.multisamplesamples != 0 ) {
    78         attr[i++] = NSOpenGLPFASamples;
    95         attr[i++] = NSOpenGLPFASamples;
    79         attr[i++] = this->gl_config.multisamplesamples;
    96         attr[i++] = this->gl_config.multisamplesamples;
    80     }
    97     }
    81 #endif
       
    82 
    98 
    83     attr[i++] = NSOpenGLPFAScreenMask;
    99     attr[i++] = NSOpenGLPFAScreenMask;
    84     attr[i++] = CGDisplayIDToOpenGLDisplayMask (display_id);
   100     attr[i++] = CGDisplayIDToOpenGLDisplayMask (display_id);
    85     attr[i] = 0;
   101     attr[i] = 0;
    86 
   102