Let me explain what I’m trying to do, since I’m not even sure this is the best way to do it.
I’m working in Win32. I am capturing video frames from an attached camera and then using that image as the background in my openGL window. Right now I’m doing this by getting the image, finding the current OpenGL context (using wglGetCurrentDC() ) and BitBlt-ing the image into this DC, then drawing my OpenGL objects.
When I do this with double buffering, I get flickering. It seems that I’m BitBlt-ing into the front buffer, which gets replaced when I swapBuffers. When I only use a single buffer, it works okay, but I have all the typical flickering associated with single buffering. So it seems that the right thing to do is double buffer and make sure that I BitBlt into the back buffer.
Hence my question: how to I get a DC for the back buffer.
I’m also open to suggestions for a better way to do this.