Re: [Leopard] Creating shared NSOpenGLView, Core Animation backed
Re: [Leopard] Creating shared NSOpenGLView, Core Animation backed
- Subject: Re: [Leopard] Creating shared NSOpenGLView, Core Animation backed
- From: David Duncan <email@hidden>
- Date: Wed, 30 Jan 2008 09:57:52 -0800
On Jan 29, 2008, at 7:35 AM, Richard Somers wrote:
Apple's LayerBackedOpenGLView sample code illustrates the sharing of
OpenGL objects (textures, display lists, etc.) between the
NSOpenGLView surface-backed context and the core animation layer-
backed context. At least that is what the comments in the code seem
to indicate.
Am I not understanding this correctly?
I believe my impression at the time that I wrote that was that he was
trying to share resources between an NSOpenGLView and an arbitrary
layer tree. Since you have no control over the context that an
arbitrary render tree uses, you have no method to specify the share
context unless you use the CARenderer - and even then, you don't have
access to the resources that CA is going to use anyway, so I'm not
certain there is much of a point.
There is an exception however, in that if your layer tree uses a
CAOpenGLLayer, then you can and do get a chance to specify a
CGLContextObj for each of them to use, in which case you can create
your own CGLContextObj that shares with arbitrary contexts, allowing
you to share resources between CAOpenGLLayers and other OpenGL
renderering objects (like NSOpenGLView). But for non-opengl layer
content, you still don't have access to the object IDs that Core
Animation creates, so you can't really share them.
I'm not certain what the comment in the LayerBackedOpenGLView sample
is referring to, as I didn't write it and am not familiar with what
optimizations may be going on behind the scenes. But in terms of
sharing OpenGL resources (textures, VBOs, FBOs, etc) you need the
object ids, and you don't have access to them no matter what you do.
--
David Duncan
Apple DTS Animation and Printing
email@hidden
_______________________________________________
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