How i can avoid the clearing problem ???


I displayed a 3d object in the MFC window.The display function is called whenever i want to display the object.I also called in OnSize()function also.Because of high redraw cpu usage i don’t called display function in OnDraw() function,i just called SwapBuffers( m_pDC->GetSafeHdc())function only.Screen clearing function glClearColor(0,0,0,1) is called inside the display function.But when i move the window very speedely then screen is not clearing fully.A light green color is shown on the window edges.

What is the problem…? Any other place to specify the screen to clear…?

Thanks in Advance…


When you stop moving does it catch up?

This is just a temporary update issue there is no fix for this if I understand you correctly. As you resize the window there is a frame or so delay for the update as the window redraws while you resize. It has to finish before it can clear for the next frame and draw, and ofcourse it is double buffered so the swapped image is always a frame behind the next draw requested.

In your ondraw you might want to switch temporarily to the frontbuffer and draw some neutral color to the frontbuffer in any recently exposed rectangular regions, then switch back to the backbuffer and continue as usual, but this would slow you down, and I don’t recommend it.

No,when i stop the moving of the window it does not catch up.
Actual problem is if i move the window beyond to the left boundary of the screen (ie; monitor), then the window client area is not clearing fully.Where i can put the clear function to avoid it ?