SDL_ttf speed question

How fast is SDL_ttf? I was going through writing a HUD for my game, and
to display various information, can I just sprintf() the info into a
char array and use SDL_ttf to render that char array every loop or
should I take the time and cache surfaces that haven’t changed?

– chris (@Christopher_Thielen)

Hi,

if you look for dynamic strings, SDL_ttf is not the way to go, because it
creates a Surface for each invoke you do. Try a lib like BFont. To use ttf’s
for it, you can check out my utility at:
http://www.2dgame-tutorial.com/sdl/fontbuilder/index.htm

It uses SDL_ttf to create the BFont compatible font-images.

Good luck!

Patrick.> ----- Original Message -----

From: chris@luethy.net (Christopher Thielen)
To:
Sent: Friday, April 18, 2003 11:56 AM
Subject: [SDL] SDL_ttf speed question

How fast is SDL_ttf? I was going through writing a HUD for my game, and
to display various information, can I just sprintf() the info into a
char array and use SDL_ttf to render that char array every loop or
should I take the time and cache surfaces that haven’t changed?

– chris (chris at luethy.net)


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hi,

if you look for dynamic strings, SDL_ttf is not the way to go, because it
creates a Surface for each invoke you do. Try a lib like BFont. To use ttf’s
for it, you can check out my utility at:
http://www.2dgame-tutorial.com/sdl/fontbuilder/index.htm

It uses SDL_ttf to create the BFont compatible font-images.

Good luck!

Patrick.

Yes and if you program in C++ use BFont++! :wink:

Gianluigi DavassiOn Fri, 18 Apr 2003 11:47:40 -0700 “Patrick Kooman” <patrick at 2dgame-tutorial.com> wrote: