[Leopard] Creating shared NSOpenGLView, Core Animation backed

  • Hi,
    is there a way to create shared NSOpenGLView (sharing textures, etc.) that
    are part of a Core Animation tree ? The context seems to be replaced by
    another one when drawing occurs.

    Thanks,

    Raphael
  • On Nov 1, 2007, at 10:05 AM, Raphael Sebbe wrote:

    > is there a way to create shared NSOpenGLView (sharing textures,
    > etc.) that
    > are part of a Core Animation tree ? The context seems to be replaced
    > by
    > another one when drawing occurs.

    You will have to use the CARenderer directly if you wish to do this.
    --
    David Duncan
    Apple DTS Quartz and Printing
    <david.duncan...>
  • 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?

    Regards,
    Richard

    On Nov 1, 2007, at 11:29AM, David Duncan wrote:

    >> is there a way to create shared NSOpenGLView (sharing textures,
    >> etc.) that
    >> are part of a Core Animation tree ? The context seems to be
    >> replaced by
    >> another one when drawing occurs.
    >
    > You will have to use the CARenderer directly if you wish to do this.
    > --
    > David Duncan
    > Apple DTS Quartz and Printing
    > <david.duncan...>
  • 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
    <david.duncan...>
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today