• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: copyCGLContextForPixelFormat
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: copyCGLContextForPixelFormat
      • From: Richard Somers <email@hidden>
References: 
 >copyCGLContextForPixelFormat (From: Richard Somers <email@hidden>)

  • Prev by Date: Getting CALayer's frame with 3D transform identity?
  • Next by Date: Re: Getting CALayer's frame with 3D transform identity?
  • Previous by thread: copyCGLContextForPixelFormat
  • Next by thread: Re: copyCGLContextForPixelFormat
  • Index(es):
    • Date
    • Thread