PDA

View Full Version : Writing to the screen



doofus
04-03-2004, 05:23 AM
I need to write to my window. I use glutBitmapCharacter and i can use an array of characters but then i need to write numbers to the screen that are stored as an int variable. Can anyone help me with this, if you can make any sense of what ive jsut written.

Cheers,

gumby
04-03-2004, 11:38 AM
You can sprintf the int into a string, then print it...

howie
04-04-2004, 01:31 PM
Nothing like a code example...

int value = 16;
char outputTxt[100];

sprintf( outputTxt, "I have %d textures in my map.", value );

The outputTxt character string says:
I have 16 textures in my map.

or

sprintf( outputTxt, "%d", value );