[SDL] Better performance needed - am I doing this right?

Colin Tuckley colin at tuckley.org
Wed Jun 6 10:49:02 PDT 2007


Eddy L O Jansson wrote:

> Wasn't a good idea anyhow, seeing how you modify the surface for each character you output.

I don't *always* modify the surface for each character, when printing a
number for example it only gets updated after all the digits have been drawn.

>   Maybe you should use a dirty-rectangle approach

As I said to Rúben, I've tried that.

You suggested timing things, How? I'm begining to suspect that it's all the
pixel manipulation thats taking the time.

>   If we ignore screen updates for a minute, I'd probably try the glyph strip (vertical, for cache-reasons) using a paletted SWSURFACE and then use SDL_SetColors() to get the color right before using a normal surface-to-surface blit. Can't swear it'd faster though, because we are talking about very small blits here, and you'd incur a conversion hit too.

Do you have an example somewhere of doing that which I could look at?

regards,

Colin

-- 
Colin Tuckley      |  colin at tuckley.org  |  PGP/GnuPG Key Id
+44(0)1903 236872  |  +44(0)7799 143369  |     0x1B3045CE

It is well known that Discworld trolls loose intelligence as they warm up.
Does this mean that a particularly hot headed troll would be a lava lout?


More information about the SDL mailing list