View Full Version : numbers to screen
03-19-2006, 10:46 PM
how do you output numbers to the window, I can print text but need numbers for scoring in a game
03-19-2006, 11:54 PM
I think you are asking how to convert a number to ASCII characters(string). It is not OpenGL question, but in C, use sprintf(). And use stringstream for C++. Then get the number as string by stringstream.str().c_str().
int score = 100;
ss << score << ends;
// your drawing function look like this
drawMyString(ss.str().c_str(), posX, posY, color, font);
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.