Re: copyCGLContextForPixelFormat
Re: copyCGLContextForPixelFormat
- Subject: Re: copyCGLContextForPixelFormat
- From: John Harper <email@hidden>
- Date: Sat, 02 Feb 2008 15:17:17 -0800
On Feb 2, 2008, at 2:25 PM, Richard Somers wrote:
CAOpenGLLayer has a copyCGLContextForPixelFormat: method which the
documentation states "allocates a new context with a null share
context".
So we make a new context based on the supplied pixel format. So why
does this method contain the word "copy"?
This method is for subclasses to override, only the CAOpenGLLayer
class should ever to call it (same for the other three similarly named
methods). The normal reason you'd want to override this is to return a
context sharing with another GL context you'd previous created. If you
override one of the -copyCGLBlah methods you should override the
related -releaseCGLBlah method to clean up whatever objects you created.
We could have called it -retainCGLContextForPixelFormat: but that
might imply you could return the same context for multiple layers at
once. "copy" implies a lack of sharing, which is how this normally
works.
John
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden