   Video Frame Freezes -- using FBO under MFC
  Hello All, I am playing a sequence of AVI frame as a video on a MFC enabled OpenGL context.Apart from setting pixel properties , GLSL is also started by using glewInit(). All this happens inside function InitOpenGL()Now in my OnPaint() I want to process each incoming frame through shaders. For this I am using FBO(frame buf. Obj.). The initialization of texture ids and FBO are done in InitOpenGL(). To give an idea, here is what my InitOpenGL() doing:InitOpenGL(){ //set context .. [using wiggle functions]  //set opengl properties  setPixelFomrat() .. //OpenGL specifics glClearColor(..) .. //start GLSL glewInit(); glGenTextures(3 , tex); glGenFramebuffersEXT(1 , &fb; ..}Now in my OnPaint() , I want to process the current frame as follows:OnPaint(){  ...  //Change On-Screen Frame Buffer to Off-Screen Frame  GLenum err = GL_NO_ERROR;  glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);   err = glGetError();  Func(); // that internally calls shader program to operate on current frame  //Calling the sequence again to change back to main frame buffer (on-screen)  GLenum err = GL_NO_ERROR;  glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);   err = glGetError(); ..}My Observations:----------------------------------------------------------------------TEST 1. When I keep both calls to  glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, <id>) but with different ids, the result is that my shader code performs the first frame is shown and then MFC screen turns black. I debugged and ensured that there is continous supply of frames.Hence no doubts on data not being provided. ----------------------------------------------------------------------TEST 2.  The error code return is 0 (i.e GL_NO_ERROR ) for twice callingglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, <id>); ,i.e when I change from onscreen to off-screen and then to on-screen.----------------------------------------------------------------------TEST 3. When I remove line glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);  but the MFC screen freezes at the  first frame only. ----------------------------------------------------------------------I am perplexed to know the behavior in Test case 3, as it should be black because the off-screen buffer is into playSimilarly, Test case 1 is also queer in the sense that when the on-screen frame buffer is brought into picture again, there should be some display at least.I referred to http://www.opengl.org/wiki/Platform_specifics:_Windows , to get some help but it is not specific to my case and I went by their suggestions to delete textures and FBO in OnDestroy(). Lastly, I do not know whether it is a good idea to use FBO under MFC becuase MFC uses lot of wglMakeCurrent() to set context. With PBO I head about the wiggle functions. But still I think that FBO can work under MFC with ease.The former is efficient as it saves time to context switch. Any suggestions and help will be appreciated. 