Allegro.cc - Online Community

Allegro.cc Forums » Game Design & Concepts » Which type of output is faster

Credits go to GullRaDriel, Lenman, and X-G for helping out!
This thread is locked; no one can reply to it. rss feed Print
Which type of output is faster
Kevin Epps
Member #5,856
May 2005
avatar

Hey Guys,

Which version of text output do you think is faster?

textprintf?

or

textout?

GullRaDriel
Member #3,861
September 2003
avatar

Isn't textout using textprintf ?

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

X-G
Member #856
December 2000
avatar

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

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Lenman
Member #4,522
April 2004
avatar

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);
}

--------------------------------------------------------
My newest game: Tough Terry|Come visit my homepage!

Perhaps I should let you all in on a little secret. No one likes you in the future. This time period is looked at as being full of lazy, self-centered, civically ignorant sheep. -John Titor

Kevin Epps
Member #5,856
May 2005
avatar

Ok, great.

I'll use textout then.

Thanks!

Tobias Dammers
Member #2,604
August 2002
avatar

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

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

Go to: