   FBO failure in MFC? Help!
  Hello,I'm trying to use FBO in MFC CWnd, as an exception occurs.First I choose the pixel format://////static PIXELFORMATDESCRIPTOR pfd;pfd.nSize  = sizeof(PIXELFORMATDESCRIPTOR);pfd.nVersion    = 1;pfd.dwFlags= PFD_DRAW_TO_WINDOW | PFD_DRAW_TO_BITMAP | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;pfd.iPixelType  = PFD_TYPE_RGBA;pfd.cColorBits  = 24;pfd.cRedBits    = 0;pfd.cRedShift   = 0;pfd.cGreenBits  = 0;pfd.cGreenShift = 0;pfd.cBlueBits   = 0;pfd.cBlueShift  = 0;pfd.cAlphaBits  = 0;pfd.cAlphaShift = 0;pfd.cAccumBits  = 0;   pfd.cAccumRedBits    = 0;pfd.cAccumGreenBits  = 0;pfd.cAccumBlueBits   = 0;pfd.cAccumAlphaBits  = 0;pfd.cDepthBits  = 32;pfd.cStencilBits= 0;pfd.cAuxBuffers = 0;pfd.iLayerType  = PFD_MAIN_PLANE;pfd.bReserved   = 0;pfd.dwLayerMask = 0;pfd.dwVisibleMask    = 0;pfd.dwDamageMask= 0;///////////////////////////////////////////////////////////////then create and use the Render Context://////m_glhRC = ::wglCreateContext(hDC);::wglMakeCurrent(hDC,m_glhRC);///////////////////////////////////////////////////////////////and then create FBO and renderbuffer object://////unsigned int framebufferID,renderbufferID;glGenFramebuffersEXT(1, &framebufferID);glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebufferID);glGenRenderbuffersEXT(1, &renderbufferID);glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, renderbufferID);glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_STENCIL_EXT, 512, 512);glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, renderbufferID);glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, renderbufferID);glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); // an exception occurs here///////////////////////////////////////////////////////////////When I call "glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)", the exception of code 0XC0000005 occurs.Can you help me and give me some sugggestion?   
  How are you loading OpenGL extensions?  Are you testing to make sure FBO is supported?  If I had to guess, I would say FBO is not supported and/or glBindFramebufferEXT is pointing to NULL/garbage location.  Make sure you test for extension support before you use it.   ;  Thanks.I have OpenGL 2.0 and GeForce 6800, and GL_EXT_framebuffer_object is definitely supported.I guess I have missed something in setting the Window, but I have no idea.   ;  Test the value of glBindFramebufferEXT and make sure it is not NULL.  Even if the extension is supported, the function may not be bound correctly.  I might also recommend using GLee as it really simplifies extension loading.   ;  The difference between GLEE and GLEW is that in GLEE, you don't need to call the init function but in GLEW, you need to call glewInit.The downside of GLEE is that every time you call a function, it checks if init was called.PS :pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_DRAW_TO_BITMAP | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;remove PFD_DRAW_TO_BITMAP   