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

Re: [pygame] sprite engine



On 4/29/06, Geekius Maximus <n00bgeek@xxxxxxxxx> wrote:
I'm working on a layering render class of my own (thank you everyone for
spreading all your great ideas), and I have a question. Which is more
efficient to update: a longer list of dirty rects that covers less total
area, or a shorter list of dirty rects that covers more total area?

I think it depends on your situation. I would suggest that you not
worry about that stuff too much unless you want to speed up a
particular app. And if you have a particular app that spends too long
drawing and you want to speed it up with dirty rect stuff, make sure
you are pulling timing and statistics (like estimated pixel counts
updated) from real world situations, so you can see how much diff your
changes have made, and so that you can catch any unexpected
performance suprises.

... but to give my guess to answer your question... If you have a
software only rendering engine, I would guess that minimizing the
coverage & overdraw is usually worth it, because blitting is almost
always the longest leg of performance, and nothing runs in parallel,
like it can with hardware acceleration.