[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Sync with vertical refresh does not work(?)



Hello, Matthias.

The problem is probably in the options of the video driver you have.
I've noticed that recently, a lot of video card drivers have sync with
vertical refresh as an option, and that this option is often disabled
by default. You need to go into the advanced OpenGL options to find
it. Hope this helps.

Mark


On Fri, Jan 30, 2009 at 1:14 PM, Matthias Treder
<matthias4all@xxxxxxxxxxxxxx> wrote:
> Hi.
>
> I saw a number of similar posts here and elsewhere on the web, but it
> didn't really answer all my questions.
> I run an experiment wherein I have to present a number of objects
> (each a circle with text on it). At certain poins in time, objects
> flash on and off (the circle radius and font size is increased, I wait
> 5 frames, and then the circle radius is decreased again). I
> implemented each object as a Sprite, so I call the update method.
> I use fullscreen mode, the objects are relatively large (circle radius
> 60-70 px) and arranged in a circle spread across large parts of the
> screen.
>
> PROBLEM: It seems there is no sync with the vertical screen refresh.
> My objects are sometimes torn.
>
> I tried about everything I could conceive of and I am kind of
> desparate now. I tried using surface.convert() after I made the Sprite
> images, and passing HWSURFACE and/or DOUBLEBUF (I also tried
> SWSURFACE) to the set_mode() function. I tried out both
> display.update() (passing the corresponding rectangles) and
> display.flip(). In the nvidia settings I also enforced vertical sync.
> Nothing seems to have any effect.
>
> My questions:
>
> 1. Is this a hardware problem or a software problem?
> 2. In the pygame docs, it says that display.update() is a more
> efficient version of display.flip(). However, does display.update()
> also wait for screen refresh just as flip() is doing?
> 3. Is the problem due to the fact that I update large parts of the screen?
> 4. Is there are any way to get rid of that flickering?
>
> Cheers,
> Matthias
>
> PS: I run Windows XP on my laptop @ 3GB RAM and 1,6 Ghz dualcore.
> Graphic card is Geforce Go 7600. It's connected to an external TFT
> monitor at a resolution of 1280x800@60 Hz.
>



-- 
Mark Wexler
Laboratoire Psychologie de la Perception
CNRS - Université Paris Descartes
45, rue des Saints-Pères
75006 Paris, France
http://wexler.free.fr