placing numbers either integer or float on screen

Hi all,
is there any function which places numbers (integers or float)on the screen directly.
i know the function glutBitmapCharacter(),
which can put only characters on the screen.

please dont suggest me to convert them to ascii and then use glutBitmapCharacter(),
i am doing the same.
but i want another method , which directly places the numbers on the screen.

my application requires to add 2 quantities and display the result along with the individual quantiies.

please help me out as soon as possible.

thanks in advance,
have a nice day

you have to use sprintf to convert it into a string and then render it

im am suggesting this to you because its the only way. thats why you have no other replies

please give me the format for the same.
i want to read a integer from array and then place it on the screen as it is.

Check out either the bitmap or the outline font tutorial at:
http://nehe.gamedev.net/opengl3.asp

thanks mdog1234,
sprintf worked out.
hope the same kind of help from u in the future also.
bye bye
have a nice day

Hiya, I know this is solved now but… I am not sure what sprintf is, but I used :

   public void RenderStringLarge(String renderStr, double x, double y){
   gl.glColor3f(1,1,1);
   gl.glRasterPos2d(x, y);  
   glut.glutBitmapString(glut.GLUT_BITMAP_TIMES_ROMAN_24, renderStr);

and then called it where ‘score’ is an int and 470 and 460 are the co-ords where to display it:
RenderStringLarge ("Score : " + score, 470, 460);

This is in Java… as I said, not sure what sprintf is, so it may be the same :slight_smile: