Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: basic sequence player

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2003
    Posts
    1

    basic sequence player

    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

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,070

    Re: basic sequence player

    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

Posting Permissions

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