Rendering Transparent QCView on another QCView

Discussion in 'Mac Programming' started by Aquis, Aug 25, 2009.

  1. Aquis macrumors member

    Joined:
    Aug 7, 2007
    Location:
    Staffordshire, UK
    #1
    I have two QCViews in my window, one on top of the other. The one in the foreground is mostly transparent, whilst the one in the background is solid. To keep the one in the foreground transparent, I had to set the erase colour to be transparent.

    Anyway, I'm having a problem in that the foreground one seems to clear the background one at the points where they intersect, revealing the window beneath, as seen in the picture. Is there anyway in which I can render the QCView on top without the one in the background being clipped where they intersect?

    [​IMG]

    Thanks!
     
  2. Aquis thread starter macrumors member

    Joined:
    Aug 7, 2007
    Location:
    Staffordshire, UK
    #2
    Okay, so I changed from using QCViews to QCCompositionLayers, but, while it's "kind of" working, it still isn't:
    [​IMG]
    It basically flickers crazily, and I see random user-interface elements strewn over it.

    Is it simply not possible to do what I'm trying to do?
     
  3. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #3
    I'm actually in the process of converting a QCView (or actually a custom NSOpenGLView that uses a QCRenderer) into a custom QCCompositionLayer (and FWIW, layers seem to be much better so far). From my experience, QCViews/NSOpenGLViews will completely block anything below them in the same window. However I haven't dealt with stacking them. Have you tried adjusting the zPosition of the layers? Does the composition on the top need to be transparent?
     
  4. Aquis thread starter macrumors member

    Joined:
    Aug 7, 2007
    Location:
    Staffordshire, UK
    #4
    Thanks for the suggestion; I tried adjusting the zIndex but, it either makes no difference or the background obscures the foreground! I think I might try drawing the transparent composition into a transparent window, and then positioning the window over the background window, but, I'm not holding my breath. I guess I probably will have to have a non-transparent compositions after all.
     
  5. Aquis thread starter macrumors member

    Joined:
    Aug 7, 2007
    Location:
    Staffordshire, UK
    #5
    Never mind, I've fixed it!

    The trick is, to add a "Clear" patch to the composition, but set the clear colour to be transparent (alpha=0).

    Thanks for your help anyway!
     
  6. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000

Share This Page