I am making a racing game and I would like to print some information such as speed, lap, key bindings etc. on the screen of my scene. I want them to be flat on the screen, having a position lets say fixed in front of the camera (like speedometers in real games) not inside my scene - if that's not possible then I ll print them inside my scene.
Do you know what functions can I use (glutBitmapCharacter?)I tried printw but my program doesn't compile. What do you propose?
There will be multiple messages printed from various routines
I have already tried this (nothing displays on screen)
glPushMatrix();
glRasterPos2f(100, 100);
glColor3f(0.0,0.5,0.1);
sprintf(message,"\nLap(User):%d",lapsB);
len = (int) strlen(message);
for (int i = 0; i < len; i++) {
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, message[i]);
}
glPopMatrix();
One more thing how can I create a menu - is there any method I can use, user will have to chose between 3 entries, input by pressing 1 or 2 or 3 on keyboard only