PDA

View Full Version : Flickering scene



BitBang
02-25-2002, 08:55 AM
Hi guys, a bit of help with this problem please. I render with opengl and no problem in my computer (windows98 amd1300 KyroII) but in other computers almost as powerful as mine, the scene is flickering (I am in window mode). I am using MFC and Visual C++6. I use swapbuffers. It looks like making too much repainting. The speed of the moving objects is fine (no slow down in other computers). I wondered if it is due to different O.S.

Thanks

Questions Burner
02-25-2002, 10:20 AM
I don't think different OS is the problem.
Are you sure you're using double buffering?

JML
02-26-2002, 12:56 AM
Do you have vertical sync enabled?

Furrage
02-26-2002, 08:34 AM
Are you using InvalidateRect(NULL, FALSE)? The FALSE prevents a clearscreen in windows which can lead to flicker.

JML, how do you enable vertical sync?

kehziah
02-26-2002, 02:48 PM
I think JML is talking about VSYNC in the driver options.

There is a proper way to handle this in an app, but some people rely on these damn driver settings. (I'm not talking about you JML)

As a result, from a perfectly valid code, you can get different results on different machines. And you've got to tell the end user "be carefull not to have this and this set in the 78th tab of the driver options otherwise it won't work/look good ....."

Furrage
02-26-2002, 03:46 PM
Just out of curiosity, I know when people used to program VGA 320x200 games there was a port programmers used to poll to determine when vertical sync took place. They'd wait till it was between refreshes to draw the image and thus avoid screen flicker. Is that sort of technique obsolete now is there some way to acheive this in OpenGL?

zeckensack
02-26-2002, 03:53 PM
Originally posted by Furrage:
Just out of curiosity, I know when people used to program VGA 320x200 games there was a port programmers used to poll to determine when vertical sync took place. They'd wait till it was between refreshes to draw the image and thus avoid screen flicker. Is that sort of technique obsolete now is there some way to acheive this in OpenGL?

In theory, it's called wglSwapIntervalEXT().
In practice, it doesn't do anything (at least not for me).

However, single buffering IS obsolete. Don't go there.

BitBang
02-27-2002, 01:15 AM
Thanks for your help. A very stupid problem. I was not including the PFD_DOUBLEBUFFER flag in the PIXELFORMATDESCRIPTOR. But what really puzzles me is the fact that it was working fine in my AMD, no flickering, and I check to see if it was including the flag without asking for it but not, the flag was not set, and there was no flickering. Only in other computers. Well, anyway, the problem is solved..

How can I enable the vertical sync?

Regards

JML
02-27-2002, 05:07 AM
How to enable/disable vsync depends on your display driver. Usually there is an option in the OpenGL section of the properties. The options are: 'on', 'off', 'default on', 'default off'.
The latter two allow programs to use a different setting programmatically (via the extension zeckensack mentioned: wglSwapIntervalEXT() ).

HTH

Jean-Marc.