I Need Help!

Using glut, I create a window in InitInstance, then call glutDisplayFunc(MyPaint) from InitInstance. MyPaint is a callback function which draws a white square inside the window. My Visual C++ program was created as a Win 32 application.

If I wanted to recolor and redisplay the square say every 1/4 second, how would I do this in OpenGL?

I’m really at a loss on this. Any help is deeply appreciated.

So long as your using GLUT you can use glutIdleFunc(…) for this purpose. It is another callback function similar to glutDisplayFunc(…) and is called when the event loop is idle. Ideal for simple animation although I think there is a glutTimerFunc(…) for more precise timing. Not quite sure about this one though…

glutTimerFunc( ) - http://www.opengl.org/developers/documentation/glut/spec3/node64.html

[This message has been edited by endo (edited 01-18-2002).]

[This message has been edited by endo (edited 01-18-2002).]