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

Re: [pygame] Paralax snow flaks: Some tipps for enhancing theperformance?



On Sun, 02 May 2004 07:23, Ludwig Auer wrote:
> Hello!
>
> I just started Programming in Python & Pygame and my first Experiment
> was a simple Paralax Starfield. This worked very well, so i added some
> stuff to simulate  snow fall (with the sinus function). No Problem at
> all...
>
> But when I tryed to extend the resolution of my programm (from 400x400
> to 1024x768) i noticed obvious performance problems. In measure of the
> fps I gained around 15 fps compared to 40-50 fps in 400x400
>
> I don't really understand this ... There are no more flake-positions
> which have to be calculated!

I would have to agree with another poster here, remember that 1024x768 is 
around 5 times the pixel count of 400x400. Although it should not be 
difficult to blit 1024x768 quickly, it will be if the format of the 
background image is not the same as the target buffer.
It would also be a good idea to check you are getting a hardware surface 
(sorry, in a rush, haven't looked through the code much).

I find that it is always a good idea to start at high res, if you can make 
things work there, then they will usually work in lower resolutions - get the 
hard work done early :)

Regards,
Stuart.