View Full Version : Displaying a counter
July 19th, 2010, 12:05 AM
Hello, all. I can't seem to figure out how to display a counter, such as a score counter, in opengl using fonts. It seems that no font library can display integers, so how would I do this? I am using C++, Kubuntu 10.04, and I am using the fnt library in plib.
July 19th, 2010, 05:31 AM
Have you considered using FreeType? There is a Windows specific tutorial on NeHe (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=43) that I found that you may be able to adapt to Linux.
July 19th, 2010, 07:06 PM
Ah, nevermind. Found the solution on the Ars Technica OpenForum:
int Number = 1834;
std::string String = static_cast<std::ostringstream*>( &(std::ostringstream() << Number) )->str();
std::cout << String;
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.