What is the proper way to add a second EAGL View on top of the QCAR camera video layer?
I'm adding a library into my QCAR implementation to display 3D models. I'm having trouble getting it properly setup so I can view the QCAR camera and my 3D layer on top of that.
I tried for a while to use the same EAGL context, but now I'm trying to keep them separate by setting up different layers using eagleview for QCAR and a view called glview for my 3D model.
My 3D model render code is in C and it doesn't mix well with the C++ QCAR code base so to get them running they need to be in separate files.
I can run them separately in the code, but when I try to load both I'm getting an error in renderFrameQCAR when my glView tries to draw on screen:
QCAR::State state = QCAR::Renderer::getInstance().begin(); - EXC_BAD_ACCESS
eaglView = [[EAGLView alloc] initWithFrame: viewBounds]; glView = [[GLView alloc] initWithFrame: viewBounds]; //new EAGL View _glViewController = [[GLViewController alloc] init]; [_glViewController setView:glView]; [window addSubview:eaglview]; [window addSubview:_glViewController.view];
Thanks for any help - this one has been a hard one to figure out!