[SDL] What is wrong with SDL_TTF?

kds71 kds71 at interia.pl
Mon Sep 12 13:20:10 PDT 2005

> The way to make it fast is to render the individual glyphs and store
> them. Then draw text by blitting the individual glyphs to the screen. If
> you are using OpenGL, then store them a textures and then texture map
> them into place. You either render each glyph as its own surface, or you
> can render the entire font into a surface and blit the appropriate parts
> of you font surface. 

Now I need to render text in SDL, not using OpenGL. But some time ago I 
was writting application in SDL and OpenGL (using SDL_TTF, too). I 
quickly realised that I will need to render each glyph separatly. So I 
wrote class TFont, which loads and initializes font, creates textures, 
OpenGL lists and so on. This class provides methods for render text and 
metrics. Code was testing on same machines - and:

- on Sempron 2500+ (256 mb ram, geforce 4) - 60 fps
- on Pentium II 450 mhz (320 mb ram, geforce 2) - 55-60 fps
- on Duron 800 mhz (256 mb ram, riva 2) - 3-4 fps!!

So results was terrible, too.

This was a digression, but I will be happy when someone tell me why it 
was so slow on duron (when I render only two digits on screen - FPS 
rating - I have about 25 fps)?

Back to topic: thanks, I hope that will work. I think that it will be 
easy to adopt my TFont and TGlyph classes from OpenGl code to SDL 
surfaces :)


Seks, zdrowie, uroda, praca... >>> http://link.interia.pl/f18b3 

More information about the SDL mailing list