Problems with redrawing, in VC++ 2005

I’m trying to write an application with OpenGL interface on VC++ 2005, borrowing heavily from a similar application I wrote last year in VC++ 2008 which works well.
However, when I refresh the GUI using RedrawWindow or Invalidate, I get white lines flashing momentarily across the OpenGL drawing area, somewhat similar to the effect you’d see on an old TV with reception problems.
This doesn’t happen when running the old application on the same PC.
Is there any known bug related to VS, OpenGL, or anything else that might be causing this? Or should I be using a different command to refresh the display?

Thanks in advance.

Does glSwapInterval(1) (aka. vsync) makes it better ?
Some GL drivers do it by default, others never, others must be told to do it.

I’m afaid it won’t compile that command. What library should it be in?

Sorry for the typo, actual name under windows is wglSwapInterval.

Still no luck. Googling this function I found another thread where you mentioned obtaining this function with GetProcAddress but you didn’t specify what DLL it should be in…

Well, I got the problem solved. Inexplicably, what was apparently missing was the ON_WM_ERASEBKGND() event; once I overrode the method OnEraseBkgnd(CDC* pDC) to always return TRUE the problem went away.

Thanks for the help though :slight_smile:

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