Skip to main content
gamedev.net
🔒 Locked

SDL Text Output

Started by Rob Loach 2 replies 1.3k views
Original Post
Rob Loach
Rob Loach
For text output we have a number of options, SDL_TTF or Bitmap Fonts are some examples. Which do you guys prefer?
Rob Loach [Website] [Projects] [
ImperfectFreak
ImperfectFreak
SDL_TTF hands down. . .It has bad documentation, but once you get past that its cake. . .
PnP Bios
PnP Bios
agreed. SDL_TTF is a blast to use. But you have to do it in chunks, you can't just render it one letter at a time. Well, you can, but it's best to get as much use out of that one surface pointer as you can.
Gaiiden
Gaiiden
SDL_TTF without a doubt. It smacked me good tho in the beginning - dragged my framerates into the single digits when I first started using it. Then I realized through profiling, as PnP Bios said, that all my time was being used up rendering the text every single frame. So make sure you always render the text once to an intermediate surface, and then just keep blitting that surface to the main surface and only re-render the text when it changes.

NOt saying you guys don't do that, just saying it for anyone coming here, checking out SDL_TTF, and making the same mistake as me [smile]
Drew Sikora
Executive Producer
GameDev.net

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.