View Full Version : Part of the window is black

11-28-2010, 07:24 PM
My OpenGL Window was working without any problem until recently one customer found this bug. Following are the steps to create this.
1. Drag the window such that part of the window is outside the desktop
2. Resize the window
3. Bring the window in to the desktop by dragging the title bar

Now you see the area which was outside the desktop as black. It is not redrawn. If I resize the window again this area starts getting updated. What could be the reason ?

11-28-2010, 11:45 PM
Already heard about something like this in these forums, but I do not remember the details.
To me this sounds like a bug in the GL driver.
Do you handle all windowing messages ?
Do you know the OS, card, drivers ?

Alfonse Reinheart
11-29-2010, 11:48 AM
It's not a driver bug. You simply did not update your window after the window was moved. Windows doesn't necessarily guarantee that the window will get a WM_PAINT message after being moved.

When you resized the window, the window got a WM_PAINT message. However, those pixels that were off screen failed the pixel ownership tests and therefore were not rendered to. Since the window did not get redrawn after moving it back on screen, those failed pixels (which are now real pixels) don't get drawn into.

So just redraw the window after a WM_MOVE.

11-29-2010, 03:13 PM
Look up the Windows system property called SPI_GETDRAGFULLWINDOWS.

You can turn off window redrawing when moving or resizing windows.

11-29-2010, 07:56 PM
Actually it cannot be that. I have a zoom capability. During zooming I am calling Invalidate() of the controller. Zooming updates the rest of the window but not the black area.

It cannot be a driver bug as well because this is there in different kinds of machines as well.