Hi there,

I subscribed to the mailing list today because I've used pygame for a
while now and I begin to be comfortable with it.

Today I've come into a strange behavior with my rendering loop.

I use dirty rectangles to update the screen so my render function
looks like this :

def draw(self):
    self.spritegroup1.clear(self.window,self.background)
    self.spritegroup2.clear(self.window,self.background)
    # ...

    dirty = self.spritegroup1.draw(self.window) +
self.spritegroup2.draw(self.window) # ...
    pygame.display.update(dirty)
    self.clock.tick (TARGET_FPS)

I've measured the time to each call to this draw function and the
"normal" time is 15ms (quite fast) but from time to time, the function
takes 500ms to execute !! And of course I see my game freezing...

Can anyone tell me where I should look at ?
-- 
Ghislain Lévêque

Reply via email to