[SDL] [SPAM] SDL blitting/refresh speed challenges

Gabriele Greco gabriele.greco at darts.it
Thu Mar 22 03:11:37 PDT 2007


A.L.Moore wrote:
> Some people are just never satisfied.  Not content with getting cross-platform 
> bitmap font handling by grace of SDL and SDL_tff, I'm trying to figure out how 
> to make it FAST.
>   
A few comments about your code:

1) Try NOT to use HWSURFACES, they are slower for anything but simple 
(opaque) blits, colorkey blits and alpha blits require the blit code to 
read the destination surface, and if that's an hardware surface it's 
very slow.

2) Use SDL_DisplayFormat() for the glyph surface, blit from 8 to 24bit 
requires at least a color lookup table, if you need to change the colors 
of your fonts and you use a limited set of colors maybe you'll have more 
luck if you use N glyph surfaces where N is the number of colors you use :)

3) RLEACCEL is useful only for SWSURFACEs, so go to point 1 :)

-- 
Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0105761240  Fax: +39-0105760224
s-mail: Via G.T. Invrea 14 - 16129 GENOVA (ITALY) 



More information about the SDL mailing list