Not redrawing when popup closes

Sometimes when a menu or a popup window closes, the OpenGL part underneath is not redrawn properly. Turns out there is no redraw event when the popup closes. Instead I presume the popup caches what’s underneath and just puts it back.

But my guess is that the OpenGL rendering has been sent down the pipeline, but not made it to the screen yet, so when the popup caches the background, it doesn’t copy the right data.

As a test, I tried drawing some win32 stuff first in OnDraw(), before doing the OpenGL stuff. Normally you only see the OpenGL rendering, which replaces the win32 stuff (after some flicker). When the bug occurs, after closing a popup, the win32 rendering is visible where the popup was, with no OpenGL rendering on top of it as there should be.

It seems that even though I have glFinish() and SwapBuffers() called at the end of OnDraw(), it still hasn’t flushed the pipeline. I also added glFlush(), but it made no difference.

Adding a short sleep after SwapBuffers() DID fix the problem, as expected, but is obviously not a usable solution.

I’m using Win2000, with an nVidia GeForce 4 Ti4200. I tried changing the level of hardware acceleration, and it did have some effect. Below a certain level it started working again, but had a new problem where the area around the cursor wasn’t redrawn properly.

Interestingly, a redraw event is sent after the first menu is opened and closed again, but only above a certain level of acceleration. From then on they don’t send redraw events (presumably caching the background like the popups). This redraw also causes a similar problem when you slide the mouse to the next menu. The redraw happens, but OpenGL isn’t flushed quick enough and the next menu caches a background that hasn’t been fully redrawn.

Any ideas?
Thanks,
Rob.

I just ran into this one. No good solution, but it was good to hear that it wasn’t just me.

Try:
My Computer -> RMB -> Properties -> Advanced Tab ->
Performance Setting -> Uncheck “Fade out menu items after clicking”

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