Switching between ShinobiChart and my own OpenGL code


I’ve got an iOS application that has its own CAEAGLLayer.   Is there documentation explaining how to have it coexist with a ShinobiChart?   At present, if I create an instance of ShinobiChart, it appears to take over the GPU and prevent me from using by own OpenGL code.     If I initialize my own OpenGL view, then the ShinobiChart fails to boot up.   I’ve figured out how to release my view and then display a ShinobiChart, by releasing all the OpenGL resources, and if I dispose of the ShinobiChart after I’m through with it, I’m able to rebuild my own OpenGL view, but I can’t create a second ShinobiChart after that.   Is there some class-level +initialize that I need to call?


Answering my own question, just in case someone else ends up here with a problem.   

The whole key is maintaing an instance of EAGLContext, and making that context current when switching away from the ShinobiChart.

        ok = [EAGLContext setCurrentContext: oglContext];

Also, for reasons I don’t quite understand, I also had to reassign the render buffer like so:

[oglContextrenderbufferStorage:GL_RENDERBUFFERfromDrawable:(CAEAGLLayer *)self.layer];