[SDL] Help to increase performance in SDL_ttf marquee program.

Bill Kendrick nbs at sonic.net
Wed Mar 31 11:33:02 PDT 2010


On Wed, Mar 31, 2010 at 08:10:20PM +0200, Christoph Nelles wrote:
> Then give us more information :p Do you cache the output or do you
> render the text every frame?

That'd be my question.  Depending on the size of the text, you may
wish to blit the entire string first, and then scroll that bitmap.
Or break it into words, and then blit them each individually.
e.g.:

  No good deed goes unpunished.

You could break that up into:
  No
  good
  deed
  goes
  unpunished.

And then, at various points during the animation, you'd be
blitting:

   |        N|o

   |     No g|ood

   |  No good|

   | good dee|d

goo|d deed go|es

 de|ed goes u|npunished

   | unpunish|ed

unp|unished  |


-bill!



More information about the SDL mailing list