PDA

View Full Version : basic sequence player



Lac
03-24-2003, 09:05 AM
Hello,

I'm writing a basic image sequence player (GLUT+GLUI): images a loaded from disk and must be displayed in a window.
When I use a spinner the refresh is done automatically. I would like to do the same thing with a button ("play") which will play the whole sequence without any click from me.

What should I do?
(I've tried to a glutPostRedisplay() but it doesn't work

Thanks in advances

Lac

nexusone
03-24-2003, 12:41 PM
I am not really sure with out seeing your code.

But glutPostRedisplay is used to refreash or update the screen data.

To be a auto loop, you need to add a timer, like glutTimerFunc.

Just after enable the glutTimerFunc to have you program run through the photo's.


void my_timer( int number )
{

next_image();
glutPostRedisplay();
glutTimerFunc( 100, my_timer, 1); // 100 is time to wait in milli seconds before next photo.
}

hope this helps.



Originally posted by Lac:
Hello,

I'm writing a basic image sequence player (GLUT+GLUI): images a loaded from disk and must be displayed in a window.
When I use a spinner the refresh is done automatically. I would like to do the same thing with a button ("play") which will play the whole sequence without any click from me.

What should I do?
(I've tried to a glutPostRedisplay() but it doesn't work

Thanks in advances

Lac