PBuffer_Create and compatible pixel format
PBuffer_Create and compatible pixel format
- Subject: PBuffer_Create and compatible pixel format
- From: Steve Christensen <email@hidden>
- Date: Thu, 24 Jun 2010 19:30:07 -0700
I'm not sure if it's better to ask here or on the OpenGL list, so
please point me there if this is off-topic.
I'm using PBuffer_Create and friends in a plugin (included in
EffectHelpers.m in the FxPlug samples). It works fine except on one of
our test computers that contains multiple graphics cards and displays.
For that case it fails with the stock code when calling
CGLCreateContext. I've ended up modifying it as follows and now works
on all of our computers.
CGLError error = kCGLNoError;
pbuffer->pixelFormat = CGLGetPixelFormat(sharedContext);
if (pbuffer->pixelFormat == NULL)
{
// do the stock pixel format setup here
//...
error = CGLChoosePixelFormat(pixelFormatAttributes, &pbuffer-
>pixelFormat, &numPixelFormats);
}
if (error == kCGLNoError)
{
error = CGLCreateContext(pbuffer->pixelFormat, sharedContext,
&pbuffer->pbufferContext);
//...
}
The problem is that I need to add a couple of attributes to the pixel
format. If I were to use the stock code, it'd be no problem: just add
it to the list. However on our problem computer, the shared context's
pixel format has two virtual screens, so I'm unsure how to get ahold
of all of the attributes, add the new ones, and then create a new
pixel format. Is this possible or am I going off in the wrong direction?
steve
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden