MAX_ATTR = 60
};
-/*mode is a __GlcontextModes*/
void
-apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const void *mode,
+apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * mode,
bool * double_buffered, bool * uses_stereo,
bool offscreen)
{
CGLPixelFormatAttribute attr[MAX_ATTR];
- const struct glx_config *c = mode;
int numattr = 0;
GLint vsref = 0;
CGLError error = 0;
*/
attr[numattr++] = kCGLPFAClosestPolicy;
- if (c->stereoMode) {
+ if (mode->stereoMode) {
attr[numattr++] = kCGLPFAStereo;
*uses_stereo = true;
}
*uses_stereo = false;
}
- if (c->doubleBufferMode) {
+ if (mode->doubleBufferMode) {
attr[numattr++] = kCGLPFADoubleBuffer;
*double_buffered = true;
}
}
attr[numattr++] = kCGLPFAColorSize;
- attr[numattr++] = c->redBits + c->greenBits + c->blueBits;
+ attr[numattr++] = mode->redBits + mode->greenBits + mode->blueBits;
attr[numattr++] = kCGLPFAAlphaSize;
- attr[numattr++] = c->alphaBits;
+ attr[numattr++] = mode->alphaBits;
- if ((c->accumRedBits + c->accumGreenBits + c->accumBlueBits) > 0) {
+ if ((mode->accumRedBits + mode->accumGreenBits + mode->accumBlueBits) > 0) {
attr[numattr++] = kCGLPFAAccumSize;
- attr[numattr++] = c->accumRedBits + c->accumGreenBits +
- c->accumBlueBits + c->accumAlphaBits;
+ attr[numattr++] = mode->accumRedBits + mode->accumGreenBits +
+ mode->accumBlueBits + mode->accumAlphaBits;
}
- if (c->depthBits > 0) {
+ if (mode->depthBits > 0) {
attr[numattr++] = kCGLPFADepthSize;
- attr[numattr++] = c->depthBits;
+ attr[numattr++] = mode->depthBits;
}
- if (c->stencilBits > 0) {
+ if (mode->stencilBits > 0) {
attr[numattr++] = kCGLPFAStencilSize;
- attr[numattr++] = c->stencilBits;
+ attr[numattr++] = mode->stencilBits;
}
- if (c->sampleBuffers > 0) {
+ if (mode->sampleBuffers > 0) {
attr[numattr++] = kCGLPFAMultisample;
attr[numattr++] = kCGLPFASampleBuffers;
- attr[numattr++] = c->sampleBuffers;
+ attr[numattr++] = mode->sampleBuffers;
attr[numattr++] = kCGLPFASamples;
- attr[numattr++] = c->samples;
+ attr[numattr++] = mode->samples;
}
attr[numattr++] = 0;