[SDL] pixels vs blit

James Eibisch jeibisch at idc.com
Wed Jan 22 22:15:01 PST 2003


>>   I wonder if that question was already discussed or not. I'm working
>>   on my own minimalistic lib to show font on the screen. I've already
>>   implemented a lot of stuff I need but now I have following question:
>>
>>   What's faster:
>>
>>   1) Lock the surface and draw pixels directly to surface.
>>
>>   or
>>
>>   2) Create a surface with a font out of the font array and then blit
>>   rectangles wherever I need to show text.
>
>The winner is... #2!

Doesn't that mean that you can't draw text in different colours though?
(Not the original question I know, but still of interest maybe.)

Unless you can somehow apply a bitmask while blitting. If your font was
stored as white (0xFFFFFF),  you could AND with 0xFF0000 while blitting to
get red text, for example. Is this possible? Otherwise, how would you draw
text of arbitrary colours without plotting pixels individually?


Explore Winning Strategies for CIOs
At IDC's Asia/Pacific IT Forum 2003:
"Beating Bottlenecks -- Key Priorities for CIOs"
January 21, 2003 -- Singapore
January 23, 2003 -- Beijing
For more information, visit http://www.idc.com.sg/apit2003






More information about the SDL mailing list