View Full Version : Control of display callback
03-03-2003, 06:56 PM
I do not understand the control flow of the display callback functions. I have yet to find a reference guide that fully explains how display callback works. I can't use a glutPostRedisplay in a loop, and I would like to know how to get an image on screen and modify the image by a variable factor each time through the loop without erasing the previous image. Any help would be greatly appreciated. Thank you.
03-03-2003, 07:52 PM
You are on the right track with glutIdleFunc. I posted on your other post. Basically all of the callback functions should be defined before calling glutMainLoop from your main function. It is not mandatory that this be the case, but typically. But, say you used the keyboard to input and could change shapes to be drawn, you could then use glutDisplayFunc or glutIdleFunc to change which function was called when idle or display. Idle is probably better for animation, though it could also be done through display with a little more effort.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.