PDA

View Full Version : Display Counter



chris_golby
02-23-2010, 02:42 AM
Hi, I'm trying to display a counter that counts up to 30 seconds on my openGl program. The counter works fine and I can see it running in the console window, the only problem is I cant get it to show up in the openGL window, A 1 flashes up and then nothing after that.

Here is my current function for displaying this:




void pause(int a)
{
startTimer();
}

void startTimer()
{
int num_1 = i % 10;
int num_10 = (i / 10) % 10;

i++;
if(i<=31)
{
if (num_10){
glRasterPos2f(1, 1);
glutBitmapCharacter(GLUT_BITMAP_9_BY_15 , 48 + num_10);
std::cout<<num_10;
}
glRasterPos2f(1, 1);
glutBitmapCharacter(GLUT_BITMAP_9_BY_15 , 48 + num_1);
std::cout<<num_1;

glutTimerFunc(1000,pause,0);
}
}



Any ideas?

Chris