Skip to main content
gamedev.net
🔒 Locked

rendering integers using FTGL

Started by jake_Ghost Apr 10, 2005 at 11:56 AM 1 replies 700+ views
Original Post
jake_Ghost
jake_Ghost
does anyone no how to do this? It outputs const char * thx Jake
Fruny
Fruny
There are plenty of classes and functions that will do formatted output to a string, like std::ostringstream in C++ or sprintf() (or preferably snprintf()) in C. It is then just a matter of writing your numbers to such a string and then passing it to whatever FTGL character-printing function you are using.

#include <sstream>int main(){   std::ostringstream oss;   int i = 42;   float f = 123.456f;   oss << "Hello " << i << " world " << f << " !!!";   FTGLwhatever(oss.str().c_str());}
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.