Normally, I would just use NSOpenGLContext, but in this case I have to have a CGContextRef as the OpenGL context in order to support some other frameworks I am using. My question is: can this be done?
I cannot afford to use glReadPixels() to fill the context because it is way to slow for this. I have to render on the entire screen (1440 x 900) at least 32 times per second, so the performance is a very big concern for me. Is there a way to make OpenGL draw into the CGContextRef efficiently, or do I need some kind of workaround?
Since it seems 1 functionality will cause issues with using the GLContext and using
glReadPixels()
instead of a CGContext. Why not make multiple contexts?Read here about the shared context, dedicate a Context to a background thread or operation queue and read your heavy operation into that and access it via the shared context to render it on the main thread context.
If you still must use a CGContextRef, can you tell us the exact frameworks that you are using that require it? People on here may be able to offer another solution