   FBO between multiple contexts
  Hi everybody.Current I was writing an plugin on some software. In this plugin, I need some FBOs to do off-screen renderings. The problem is the software environment will change the openGL context in the back in some conditions, and the SDK provides no callback functions to let me do something when context is being changed.I have some VBOs and textures, and after checking some documents I knew they can be shared between multiple contexts automatically. But FBO can't. I have two solutions: one, create FBO every frame, so I don't worry about the context changing; two, in the plugin's code, I create my own context, and every frame when I need to do some rendering, I call wglMakeCurrent to set my own context. But I think the two methods are both ugly.Also, I think about everytime I find the context has been change, I create new framebuffer objects on the new context. But in this way, I can't delete the old FBOs, since I don't know whether the old context has been deleted. And I don't know whether these old FBOs will be deleted too when the context is deleted, If they won't, I have no way to delete them.If you know some elegant way to handle such situation, please help me, thanks.   
  OpenGL's context handling is ugly at best. I tend to use wglMakeCurrent with different HDC's where others setup multiple RC's.From what I understand FBO will be shared in contexts if the contexts were set as copies at creation time. If contexts are not then they will not share. From what I also understand any resources bound to a context will be free'd at the destruction of the context.Knowing this I'd say your best bet is to track the contexts in which you've already created the FBO with some map FBO <-> context then look it up when you need it. If it doesn't exist, create it.This seems like the safest and most efficient method.   ;  Ahh, I may have mispoken. I read FBO as VBO, my bad. It may not be shared for contexts. Still, I would use the same idea.   