   Printing Varibles on screen in OpenGL
  i have set up a function to print strings on screen using the glutBitmapCharacter function and i can print text strings i pass to the function fine.the problem is i want to also print a varialbe to the screen to implement a scoring system, ie. Score: <value>, where value is an integer varibale.how can you print this varible on screen?   
  Hi,You could make use of sprintfAn example of this would be something like ...char screenText[100];int someInteger = 10;sprintf(screenText,"The integer has value: %d",someInteger);renderer->drawText(screenText,10,10);All the best,ViLiO   ;  Great, it works a treat :Dthanks very much.   ;  sprintf is evil. At the very least use snprintf, which has added protection against buffer overruns.  In C++ you should also consider stringstreams, boost::lexical_cast and/or boost::format, which are more idiomatic C++.Enigma   ;  ^^ Exactly what he said, if you're using C++, use C++ :)   ;  Personally I prefer using varargs and calling vsnprintf from within my text output function. It saves creating a temporary buffer (and accidentally overflowing it with sprintf in multiple locations).That way you can just call renderer->drawText(10, 10, "The integer has value: %d", someInteger);Keep in mind that this is C. If you're using C++, as others have mentioned, you're better off using streams.   