Which type of output is faster
Kevin Epps

Hey Guys,

Which version of text output do you think is faster?

textprintf?

or

textout?

GullRaDriel

Isn't textout using textprintf ?

X-G

Assuming it doesn't... textout, for obvious reasons.

Lenman
Quote:

Isn't textout using textprintf ?

Wouldn't make sense to me. textprintf formatting the text and then using textout would be much more plausible.

EDIT: I just decided to take a look at the source to find out :)
EDIT2: I was right, textprintf_ex calls textout_ex.

void textprintf_ex(BITMAP *bmp, AL_CONST FONT *f, int x, int y, int color, int bg, AL_CONST char *format, ...)
{
   char buf[512];
   va_list ap;
   ASSERT(bmp);
   ASSERT(f);
   ASSERT(format);

   va_start(ap, format);
   uvszprintf(buf, sizeof(buf), format, ap);
   va_end(ap);

   textout_ex(bmp, f, buf, x, y, color, bg);
}

Kevin Epps

Ok, great.

I'll use textout then.

Thanks!

Tobias Dammers

General rule of thumb: Use textprintf when you need the formatting, textout when you don't.

Thread #563790. Printed from Allegro.cc