View Full Version : How to write number bigger than 9?
11-29-2003, 01:27 PM
I used following command to write number and character on the graphic:
As you can see, if the value in c[i][j] is bigger than 9, it prints out those special characters and ABCD.....
How can I write something like 100 or 15?
11-29-2003, 01:32 PM
Try extracting each digit in the number
and printing out digit by digit.
You can do this by % the number by 10, and then divide by 10. Keep doing until you hit the digits mark.
11-29-2003, 02:44 PM
Here is a routine I wrote to print text on the screen, with glutBitmapCharacter.
// I use this to put text on the screen
void Sprint( int x, int y, char *st)
l=strlen( st ); // see how many characters are in text string.
glRasterPos2i( x, y); // location to start printing text
for( i=0; i < l; i++) // loop until i is greater then l
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, st[i]); // Print a character on the screen
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.