- case WX_GL_RGBA: data[p++] = GLX_RGBA; break;
- case WX_GL_BUFFER_SIZE:
- data[p++]=GLX_BUFFER_SIZE; data[p++]=attribList[arg++]; break;
- case WX_GL_LEVEL:
- data[p++]=GLX_LEVEL; data[p++]=attribList[arg++]; break;
- case WX_GL_DOUBLEBUFFER: data[p++] = GLX_DOUBLEBUFFER; break;
- case WX_GL_STEREO: data[p++] = GLX_STEREO; break;
- case WX_GL_AUX_BUFFERS:
- data[p++]=GLX_AUX_BUFFERS; data[p++]=attribList[arg++]; break;
- case WX_GL_MIN_RED:
- data[p++]=GLX_RED_SIZE; data[p++]=attribList[arg++]; break;
- case WX_GL_MIN_GREEN:
- data[p++]=GLX_GREEN_SIZE; data[p++]=attribList[arg++]; break;
- case WX_GL_MIN_BLUE:
- data[p++]=GLX_BLUE_SIZE; data[p++]=attribList[arg++]; break;
- case WX_GL_MIN_ALPHA:
- data[p++]=GLX_ALPHA_SIZE; data[p++]=attribList[arg++]; break;
- case WX_GL_DEPTH_SIZE:
- data[p++]=GLX_DEPTH_SIZE; data[p++]=attribList[arg++]; break;
- case WX_GL_STENCIL_SIZE:
- data[p++]=GLX_STENCIL_SIZE; data[p++]=attribList[arg++]; break;
- case WX_GL_MIN_ACCUM_RED:
- data[p++]=GLX_ACCUM_RED_SIZE; data[p++]=attribList[arg++]; break;
- case WX_GL_MIN_ACCUM_GREEN:
- data[p++]=GLX_ACCUM_GREEN_SIZE; data[p++]=attribList[arg++]; break;
- case WX_GL_MIN_ACCUM_BLUE:
- data[p++]=GLX_ACCUM_BLUE_SIZE; data[p++]=attribList[arg++]; break;
- case WX_GL_MIN_ACCUM_ALPHA:
- data[p++]=GLX_ACCUM_ALPHA_SIZE; data[p++]=attribList[arg++]; break;
- default:
- break;
+ switch( wx_attribList[arg++] )
+ {
+ case WX_GL_RGBA:
+ if (wxGLCanvas::GetGLXVersion() <= 12)
+ // for GLX >= 1.3, GLX_RGBA is useless (setting this flags will crash on most opengl implm)
+ gl_attribList[p++] = GLX_RGBA;
+ break;
+ case WX_GL_BUFFER_SIZE:
+ gl_attribList[p++] = GLX_BUFFER_SIZE;
+ gl_attribList[p++] = wx_attribList[arg++];
+ break;
+ case WX_GL_LEVEL:
+ gl_attribList[p++] = GLX_LEVEL;
+ gl_attribList[p++] = wx_attribList[arg++];
+ break;
+ case WX_GL_DOUBLEBUFFER:
+ if (wxGLCanvas::GetGLXVersion() <= 12)
+ gl_attribList[p++] = GLX_DOUBLEBUFFER;
+ else
+ // for GLX >= 1.3, GLX_DOUBLEBUFFER format is different (1 <=> True)
+ // it seems this flag is useless for some hardware opengl implementation.
+ // but for Mesa 6.2.1, this flag is used so don't ignore it.
+ gl_attribList[p++] = GLX_DOUBLEBUFFER;
+ gl_attribList[p++] = 1;
+ break;
+ case WX_GL_STEREO:
+ gl_attribList[p++] = GLX_STEREO;
+ break;
+ case WX_GL_AUX_BUFFERS:
+ gl_attribList[p++] = GLX_AUX_BUFFERS;
+ gl_attribList[p++] = wx_attribList[arg++];
+ break;
+ case WX_GL_MIN_RED:
+ gl_attribList[p++] = GLX_RED_SIZE;
+ gl_attribList[p++] = wx_attribList[arg++];
+ break;
+ case WX_GL_MIN_GREEN:
+ gl_attribList[p++] = GLX_GREEN_SIZE;
+ gl_attribList[p++] = wx_attribList[arg++];
+ break;
+ case WX_GL_MIN_BLUE:
+ gl_attribList[p++] = GLX_BLUE_SIZE;
+ gl_attribList[p++] = wx_attribList[arg++];
+ break;
+ case WX_GL_MIN_ALPHA:
+ gl_attribList[p++] = GLX_ALPHA_SIZE;
+ gl_attribList[p++] = wx_attribList[arg++];
+ break;
+ case WX_GL_DEPTH_SIZE:
+ gl_attribList[p++] = GLX_DEPTH_SIZE;
+ gl_attribList[p++] = wx_attribList[arg++];
+ break;
+ case WX_GL_STENCIL_SIZE:
+ gl_attribList[p++] = GLX_STENCIL_SIZE;
+ gl_attribList[p++] = wx_attribList[arg++];
+ break;
+ case WX_GL_MIN_ACCUM_RED:
+ gl_attribList[p++] = GLX_ACCUM_RED_SIZE;
+ gl_attribList[p++] = wx_attribList[arg++];
+ break;
+ case WX_GL_MIN_ACCUM_GREEN:
+ gl_attribList[p++] = GLX_ACCUM_GREEN_SIZE;
+ gl_attribList[p++] = wx_attribList[arg++];
+ break;
+ case WX_GL_MIN_ACCUM_BLUE:
+ gl_attribList[p++] = GLX_ACCUM_BLUE_SIZE;
+ gl_attribList[p++] = wx_attribList[arg++];
+ break;
+ case WX_GL_MIN_ACCUM_ALPHA:
+ gl_attribList[p++] = GLX_ACCUM_ALPHA_SIZE;
+ gl_attribList[p++] = wx_attribList[arg++];
+ break;
+ default:
+ break;
+ }