I am developing an OpenGL application in C#.NET (by using CsGL, http://csgl.sourceforge.net ) and experiencing a strange problem. I do not know what is causing it (Windows XP or nVidia video card). The problem is present if the following code is included in OpenGL class (derived from OpenGLControl):
private bool draw = true;
protected override void OnPaint(PaintEventArgs pevent)
draw = false;
(If you have CsGL, you can just add this code to class MyView in quadric example which comes with CsGL)
This code simulate a situation where the OpenGL scene is static (nothing is moving inside the scene) and too complex to be repainted each time paint even is raised (e.g., when some other windows are moving on top of the scene). Therefore, scene is rendered only once, and after that, SwapBuffer method refreshes the scene. In order to keep this example simple, there is no code for resizing the scene, etc.
Now, here is the problem. If such OpenGL window is moved first completely to the left (so that it is almost out of the screen) and then start moving slowly back (to the right), OpenGL scene will jump left/right inside the window and vertical gray stripe (window background) will appear from time to time. In addition, during the movement, scene is repainted from the left visible edge of the window (i.e., not from the real left edge which is out of the screen during the movement).
This problem is present at two XP PCs with different nVidia video cards, but NOT on a very old PC with NT 4.0 and ATI Rage 128 PRO video card.
Any help would be greatly appreciated.
[This message has been edited by pjfry (edited 09-10-2003).]