Flicker with openGL and UpdateLayeredWindow

I have an app that has problems with flickering.

Let me explain how the application works which is non-standard.

  1. I use wglChoosePixelFormatARB with a parameter of 4 to try to find 4x multisampling. If that fails i try for 2x, otherwise i default to normal pixel format.

  2. I am enabling 4xAA using glEnable(GL_MULTISAMPLE_ARB) when I init.

  3. I once per second, I use simple gl commands to draw to the back buffer and call glFinish, then copy the backbuffer to a DIB using glReadPixels where I am doing some extra processing to the image using GDI.

  4. The result is finally drawn to windows using UpdateLayeredWindow.

I can see that when I call UpdateLayeredWindow the resultant DIB does appear on the screen, but the temporary backbuffers flicker on the screen as well.

What could cause the back buffer to appear on the windows desktop. Im not calling swapbuffers at all, as far as I know.

Problem resolved.

I wrapped the code that draws on the backbuffer so its the only time its visible. Otherwise, I make it invisible.

It needs to be visible to be drawn using openGL, but invisible at all other times to prevent updatelayeredWindow from copying the ‘empty’ front buffer to the screen.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.