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

Re: [pygame] Some problem with WinXP Home and PyGame 1.7.1



Tomasz Primke wrote:
[snip lots of diagnostic info]

So, AFAIK, my technique was the fastest one known in the PyGame world. I haven't been updating whole screen (as it is done in most apps, that I have checked - e.g. the wonderful game "Trip on a Funny Boat", where the screen is updated with the pygame.display.flip() function). I have been updating only those rects, that were affected by some drawing/blitting operations.

And the fact is that after exchanging pygame.display.flip() with pygame.display.update( list_of_dirty_rects ) I got very significant increase of FPS. So I decided to stay with that faster code. Later I removed those HWSURFACE and DOUBLEBUF under Windows and my app finally ran. Well - it ran, but it was much, much slower than under my GNU/Linux.
Would you trust me with your code to test it, and see what kind of performance I get?
(i'm assuming you're running both of these things on the same computer, otherwise you can't compare
the performance and say 'Windows is the problem!')
It sounds to me that perhaps you don't have the latest graphics card drivers and directx.



A fullscreen (probably software) surface at 1024,768 (I don't know how to check refresh rate)
that's updating the whole screen (but nothing is changed)
gets 170 FPS or so, as per the code
#fullscreen_test.py
import pygame
from pygame.locals import *


SCREENSIZE = 1024, 768


pygame.init() clock = pygame.time.Clock() scr = pygame.display.set_mode(SCREENSIZE,FULLSCREEN) f = file('results.txt','w') while 1: clock.tick() pygame.display.update() f.write("FPS IS : %s\n" % clock.get_fps()) for event in pygame.event.get(): if event.type == KEYDOWN: if event.key == K_ESCAPE: pygame.quit() f.close() raise SystemExit

if __name__ == "__main__":
   main()

#------
so, if I were to use dirty rects, I would get much higher FPS than this.
On Kamilche's rain generator demo, I got 2,500 FPS, because the update rects were so small.


So, I'd say, try Kamilche's demo, see what FPS you get, and if that's low too, you almost definitely have something other than pygame
that's causing slowdowns.


HTH,
-Luke
Eventually I might end up with making my own Linux Live-CD distro, that runs my PyGame apps directly after booting (for all those poor people, who use Windows systems ;-) ).
No offense,but if I have to reboot my computer to test your game, in addition to having to burn a CD for it,
I almost definitely won't.
Whenever I get the urge to play a game, I'm usually right in the middle of a bunch of stuff, and I can't just
close everything and reboot.
I think you should try to fix these performance problems instead :)
Imagine if I asked you to reboot into Windows from Linux to try my game ;)