For all my text in SDL I use SDL_ttf and ttf fonts (fontspace.com is a great website for these). Load the font (TTF_OpenFont), then load the text to a SDL_Surface (I use TTF_RenderText_Blended for quality, there are others that are quicker with lower quality), then blit the surface to screen. All of this is done in my ImageCache class, which is probably similar to what you're trying to achieve.
This doesn't give me any noticeable slowdown at all and I redraw the entire screen every frame (same as you), but then all of my games are capped at 60fps.
Show differencesHistory of post edits
#1sednihp
Posted 21 June 2012 - 12:00 PM
For all my text in SDL I use SDL_ttf and ttf fonts. Load the font (TTF_OpenFont), then load the text to a SDL_Surface (I use TTF_RenderText_Blended for quality, there are others that are quicker with lower quality), then blit the surface to screen. All of this is done in my ImageCache class, which is probably similar to what you're trying to achieve.
This doesn't give me any noticeable slowdown at all and I redraw the entire screen every frame (same as you), but then all of my games are capped at 60fps.
This doesn't give me any noticeable slowdown at all and I redraw the entire screen every frame (same as you), but then all of my games are capped at 60fps.