I'm trying, unsuccessfully, to combine OpenGL content with other CALayers. In particular, I would like to overlay the OpenGL content above the other layers (with alpha transparency).
I run into two problems:
- My OpenGL rendering is never displayed (even though the OpenGL functions succeeds).
- The OpenGL rendering is awfully slow (around 1 fps).
I should note that I'm not using a CAEAGLLayer-backed view. Instead, I'm using a custom CAEAGLLayer subclass directly. This may be the problem for #1. Using a layer-backed view may work, but I'm not sure how to proceed to make it transparent.
Regarding #2, I'm aware that the documentation says that there is a performance penalty into mixing EAGLLayers with other layers, and that settings the opaque property to NO is even more costly. But 1 fps seems unreasonably slow.
Any suggestion and/or comments would be appreciated.
EDIT
The GL layer do work when used as a backing-layer of a view. It is not convenient though as I want to use the GL layer in a CALayer hierarchy.
SOLUTION
My mistake, using a CAEAGLLayer works just fine. Silly mistake from my part (I wasn't adding the right layer in the hierarchy).