Re: PBuffer_Create: CGLCreateContext failing with error 10009
Re: PBuffer_Create: CGLCreateContext failing with error 10009
- Subject: Re: PBuffer_Create: CGLCreateContext failing with error 10009
- From: Darrin Cardani <email@hidden>
- Date: Thu, 10 Jun 2010 11:12:46 -0700
Steve,
Have you tried using the [-FxHostCapabilities
glContextPixelFormatAttributes:] method? Does that return the correct
results for you?
Darrin
On Jun 8, 2010, at 9:52 PM, Steve Christensen wrote:
I am using PBuffer_Create (EffectHelpers.mm) in my plugin to set up
a pbuffer for drawing. All works well on my computer, but it's
failing with error 10009 (invalid share context) on a tester's
computer that has multiple monitors and graphics cards.
I added some code to the beginning of PBuffer_Create to print out
the pixel format info for the shared context
(renderInfo.sharedContext) and got the following:
screenIndex = 0: kCGLPFANoRecovery = 1
screenIndex = 0: kCGLPFAAccelerated = 1
screenIndex = 0: kCGLPFAWindow = 1
screenIndex = 0: kCGLPFADisplayMask = 1
screenIndex = 0: kCGLPFAColorSize = 32
screenIndex = 0: kCGLPFADepthSize = 16
screenIndex = 1: kCGLPFANoRecovery = 1
screenIndex = 1: kCGLPFAAccelerated = 1
screenIndex = 1: kCGLPFAWindow = 1
screenIndex = 1: kCGLPFADisplayMask = 12
screenIndex = 1: kCGLPFAColorSize = 32
screenIndex = 1: kCGLPFADepthSize = 16
The pixel format attributes are set up as follows, which is how
Apple's sample plugin code is set up.
CGLPixelFormatAttribute pixelFormatAttributes[] =
{
kCGLPFANoRecovery,
kCGLPFAAccelerated,
kCGLPFAWindow,
kCGLPFADisplayMask,
(CGLPixelFormatAttribute
)CGDisplayIDToOpenGLDisplayMask(CGMainDisplayID()),
kCGLPFAColorSize, (CGLPixelFormatAttribute)(colorDepth * 4),
kCGLPFADepthSize, (CGLPixelFormatAttribute)16,
(colorDepth > 8) ? kCGLPFAColorFloat : (CGLPixelFormatAttribute)0,
(CGLPixelFormatAttribute)0
};
The only change I notice is in the kCGLPFADisplayMask value between
the two screens.
Would this be the likely cause of the issues I'm seeing, and does it
mean that I need to modify PBuffer_Create to set up its
CGLPixelFormatObj with the same values for kCGLPFADisplayMask as in
the shared context? If so, what do I need to be looking for?
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
--
Darrin Cardani
email@hidden
_______________________________________________
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