Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: glutBitmapString misses blank spaces

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2009

    glutBitmapString misses blank spaces

    It seems that glutBitmapString misses blank spaces.
    I am making an animation, at each time step, I use glutBitmapString to print out some information like this,

    sprintf(message, "step=%-8d t=%-15g mass=", step, t);
    glutBitmapString(GLUT_BITMAP_HELVETICA_18, (unsigned char*) message);

    however, as the variables step ,t, change at each time step, and the message is of different length which should not be ( If I use printf("%s\n",message) to print the same message to screen, it is of exact length and mass aligns at the same column). I need "mass=" to apear at the exact location at each time step.

    Anybody else has met the same problem? Any suggestion how to fix it?

  2. #2
    Senior Member OpenGL Pro BionicBytes's Avatar
    Join Date
    Mar 2009
    UK, London

    Re: glutBitmapString misses blank spaces

    work around the problem.
    Break the print statement up into two or more parts and use gltranslatef to position the printing of the string.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts