Same framebuffer multiple contexts

I have two contexts running in their own individual threads and accessing the same framebuffer. If fails in an odd way for me. When I debug the code, the bindFrameBuffer call does not cause immediate trouble, but a subsequent call to any opengl function does. Currently the failing function if glGetError.

What I am trying to do is to render and swap in one thread and while it renders to the backbuffer, I am copying out pixels from the frontbuffer and sending them to another device.

The framebuffer I am trying to share this way is an extra framebuffer that I created myself (id=1) for offscreen rendering.

Is there a problem with this sharing?

Use one context and PBO for reading

framebuffer objects (FBO) can not be shared. But textures used to build a FBO can be shared.

ref: Spec 4.0, appendix D, Shared Objects and Multiple Contexts, page 389: “Framebuffer, query, and vertex array objects are not shared”

http://www.opengl.org/registry/doc/glspec40.core.20100311.withchanges.pdf

Ok. Sharing the texture into which the framebuffer writes graphics, that is just as well. Thanks for the pointer.