- switch( attribList[arg++] )
- {
- case WX_GL_RGBA:
- pfd.iPixelType = PFD_TYPE_RGBA;
- break;
- case WX_GL_BUFFER_SIZE:
- pfd.cColorBits = (BYTE)attribList[arg++];
- break;
- case WX_GL_LEVEL:
- // this member looks like it may be obsolete
- if (attribList[arg] > 0) {
- pfd.iLayerType = (BYTE)PFD_OVERLAY_PLANE;
- } else if (attribList[arg] < 0) {
- pfd.iLayerType = (BYTE)PFD_UNDERLAY_PLANE;
- } else {
- pfd.iLayerType = (BYTE)PFD_MAIN_PLANE;
- }
- arg++;
- break;
- case WX_GL_DOUBLEBUFFER:
- pfd.dwFlags |= PFD_DOUBLEBUFFER;
- break;
- case WX_GL_STEREO:
- pfd.dwFlags |= PFD_STEREO;
- break;
- case WX_GL_AUX_BUFFERS:
- pfd.cAuxBuffers = (BYTE)attribList[arg++];
- break;
- case WX_GL_MIN_RED:
- pfd.cColorBits = (BYTE)(pfd.cColorBits + (pfd.cRedBits = (BYTE)attribList[arg++]));
- break;
- case WX_GL_MIN_GREEN:
- pfd.cColorBits = (BYTE)(pfd.cColorBits + (pfd.cGreenBits = (BYTE)attribList[arg++]));
- break;
- case WX_GL_MIN_BLUE:
- pfd.cColorBits = (BYTE)(pfd.cColorBits + (pfd.cBlueBits = (BYTE)attribList[arg++]));
- break;
- case WX_GL_MIN_ALPHA:
- // doesn't count in cColorBits
- pfd.cAlphaBits = (BYTE)attribList[arg++];
- break;
- case WX_GL_DEPTH_SIZE:
- pfd.cDepthBits = (BYTE)attribList[arg++];
- break;
- case WX_GL_STENCIL_SIZE:
- pfd.cStencilBits = (BYTE)attribList[arg++];
- break;
- case WX_GL_MIN_ACCUM_RED:
- pfd.cAccumBits = (BYTE)(pfd.cAccumBits + (pfd.cAccumRedBits = (BYTE)attribList[arg++]));
- break;
- case WX_GL_MIN_ACCUM_GREEN:
- pfd.cAccumBits = (BYTE)(pfd.cAccumBits + (pfd.cAccumGreenBits = (BYTE)attribList[arg++]));
- break;
- case WX_GL_MIN_ACCUM_BLUE:
- pfd.cAccumBits = (BYTE)(pfd.cAccumBits + (pfd.cAccumBlueBits = (BYTE)attribList[arg++]));
- break;
- case WX_GL_MIN_ACCUM_ALPHA:
- pfd.cAccumBits = (BYTE)(pfd.cAccumBits + (pfd.cAccumAlphaBits = (BYTE)attribList[arg++]));
- break;
- default:
- break;
- }
+ switch ( attribList[arg++] )
+ {
+ case WX_GL_RGBA:
+ pfd.iPixelType = PFD_TYPE_RGBA;
+ break;
+ case WX_GL_BUFFER_SIZE:
+ pfd.cColorBits = attribList[arg++];
+ break;
+ case WX_GL_LEVEL:
+ // this member looks like it may be obsolete
+ if ( attribList[arg] > 0 )
+ pfd.iLayerType = PFD_OVERLAY_PLANE;
+ else if ( attribList[arg] < 0 )
+ pfd.iLayerType = (BYTE)PFD_UNDERLAY_PLANE;
+ else
+ pfd.iLayerType = PFD_MAIN_PLANE;
+ arg++;
+ break;
+ case WX_GL_DOUBLEBUFFER:
+ pfd.dwFlags |= PFD_DOUBLEBUFFER;
+ break;
+ case WX_GL_STEREO:
+ pfd.dwFlags |= PFD_STEREO;
+ break;
+ case WX_GL_AUX_BUFFERS:
+ pfd.cAuxBuffers = attribList[arg++];
+ break;
+ case WX_GL_MIN_RED:
+ pfd.cColorBits = (pfd.cColorBits +
+ (pfd.cRedBits = attribList[arg++]));
+ break;
+ case WX_GL_MIN_GREEN:
+ pfd.cColorBits = (pfd.cColorBits +
+ (pfd.cGreenBits = attribList[arg++]));
+ break;
+ case WX_GL_MIN_BLUE:
+ pfd.cColorBits = (pfd.cColorBits +
+ (pfd.cBlueBits = attribList[arg++]));
+ break;
+ case WX_GL_MIN_ALPHA:
+ // doesn't count in cColorBits
+ pfd.cAlphaBits = attribList[arg++];
+ break;
+ case WX_GL_DEPTH_SIZE:
+ pfd.cDepthBits = attribList[arg++];
+ break;
+ case WX_GL_STENCIL_SIZE:
+ pfd.cStencilBits = attribList[arg++];
+ break;
+ case WX_GL_MIN_ACCUM_RED:
+ pfd.cAccumBits = (pfd.cAccumBits +
+ (pfd.cAccumRedBits = attribList[arg++]));
+ break;
+ case WX_GL_MIN_ACCUM_GREEN:
+ pfd.cAccumBits = (pfd.cAccumBits +
+ (pfd.cAccumGreenBits = attribList[arg++]));
+ break;
+ case WX_GL_MIN_ACCUM_BLUE:
+ pfd.cAccumBits = (pfd.cAccumBits +
+ (pfd.cAccumBlueBits = attribList[arg++]));
+ break;
+ case WX_GL_MIN_ACCUM_ALPHA:
+ pfd.cAccumBits = (pfd.cAccumBits +
+ (pfd.cAccumAlphaBits = attribList[arg++]));
+ break;
+ }