src/video/quartz/SDL_QuartzVideo.m
changeset 308 ee32ed29a507
parent 297 f6ffac90895c
child 324 f25f666d609a
equal deleted inserted replaced
307:0185452e9f83 308:ee32ed29a507
  1206     return function;
  1206     return function;
  1207 }
  1207 }
  1208 
  1208 
  1209 static int    QZ_GL_GetAttribute   (_THIS, SDL_GLattr attrib, int* value) {
  1209 static int    QZ_GL_GetAttribute   (_THIS, SDL_GLattr attrib, int* value) {
  1210 
  1210 
  1211 /*
  1211     GLenum attr;
  1212     CGLContextRef ctx = [ gl_context cglContext ];
  1212 
  1213     CGLContextParameter param;
  1213     QZ_GL_MakeCurrent (this);
  1214     
  1214 
  1215     switch (attrib) {
  1215     switch (attrib) {
  1216     case SDL_GL_RED_SIZE: param = CGLContextParameter break;
  1216     case SDL_GL_RED_SIZE: attr = GL_RED_BITS;   break;
  1217     
  1217     case SDL_GL_BLUE_SIZE: attr = GL_BLUE_BITS;  break;
  1218     }
  1218     case SDL_GL_GREEN_SIZE: attr = GL_GREEN_BITS; break;
  1219     
  1219     case SDL_GL_ALPHA_SIZE: attr = GL_ALPHA_BITS; break;
  1220     CGLGetParameter (ctx, param, (long*)value);
  1220     case SDL_GL_DOUBLEBUFFER: attr = GL_DOUBLEBUFFER; break;
  1221 */
  1221     case SDL_GL_DEPTH_SIZE: attr = GL_DEPTH_BITS;  break;
  1222 
  1222     case SDL_GL_STENCIL_SIZE: attr = GL_STENCIL_BITS; break;
  1223     *value = -1;
  1223     case SDL_GL_ACCUM_RED_SIZE: attr = GL_ACCUM_RED_BITS; break;
  1224     return -1;
  1224     case SDL_GL_ACCUM_GREEN_SIZE: attr = GL_ACCUM_GREEN_BITS; break;
       
  1225     case SDL_GL_ACCUM_BLUE_SIZE: attr = GL_ACCUM_BLUE_BITS; break;
       
  1226     case SDL_GL_ACCUM_ALPHA_SIZE: attr = GL_ACCUM_ALPHA_BITS; break;
       
  1227     case SDL_GL_BUFFER_SIZE:
       
  1228         {
       
  1229             GLint bits = 0;
       
  1230             GLint component;
       
  1231 
       
  1232             /* there doesn't seem to be a single flag in OpenGL for this! */
       
  1233             glGetIntegerv (GL_RED_BITS, &component);   bits += component;
       
  1234             glGetIntegerv (GL_GREEN_BITS,&component);  bits += component;
       
  1235             glGetIntegerv (GL_BLUE_BITS, &component);  bits += component;
       
  1236             glGetIntegerv (GL_ALPHA_BITS, &component); bits += component;
       
  1237 
       
  1238             *value = bits;
       
  1239         }
       
  1240         return 0;
       
  1241     }
       
  1242 
       
  1243     glGetIntegerv (attr, value);
       
  1244     return 0;
  1225 }
  1245 }
  1226 
  1246 
  1227 static int    QZ_GL_MakeCurrent    (_THIS) {
  1247 static int    QZ_GL_MakeCurrent    (_THIS) {
  1228     [ gl_context makeCurrentContext ];
  1248     [ gl_context makeCurrentContext ];
  1229     return 0;
  1249     return 0;