Allegro al_draw_textf

Posted 15 January 2013 - 11:28 AM

Hi! I'm writing a very simple program using Allegro to play with fonts for a class project. It runs well with one exception, it's not displaying a variable value inside my textf statement. My professor has looked it over and doesn't understand why, so we are a bit stumped. Are we missing something obvious? The output screen should say "This message will self destruct in 10 seconds", but instead it says "This screen will self destruct in seconds".

I've spent a chunk of time this morning reading the Allegro manual and a couple of forum posts, but I'm not finding anything wrong with my code. The textf block is on lines 45-50 I believe. Thank you!

Re: Allegro al_draw_textf

Posted 15 January 2013 - 02:41 PM

synlight, on 15 January 2013 - 08:23 PM, said:

Yes, I tried %d.. same result. This is the strangest problem ever. Thank you for trying though!

I compiled the code in MSVC++ 2010 (using Allegro 5.0.8 and linking 'allegro-5.0.8-monolith-md-debug.lib'), downloaded the font file "Orange Juice.tff" and didn't have the same problem. The code seems to work as intended.

Screenshot.

Seems that it could be something wrong with your Allegro setup, perhaps.

Yes, I tried %d.. same result. This is the strangest problem ever. Thank you for trying though!

I compiled the code in MSVC++ (using Allegro 5.0.8 and linking 'allegro-5.0.8-monolith-md-debug.lib'), downloaded the font file "Orange Juice.tff" and don't have the same problem. The code seems to work as intended.