Why couldn't you have said that in your opening question?
Just because I figured the question had been asked a lot. Anyway...
Basically, a display function is given to GLUT to use: glutDisplayFunc(myRenderSceneFunction).
glutIdlefunc() is given a function to do whenever the program is idle. Most beginner tutorials have this function calling "MyRenderSceneFunction", so basically the graphics card catches on fire.
The solution is to set up a timer and use glutPostRedisplay, which would call the function defined with glutDisplayFunc(). Here's the code for the timer function that I have right now:
void update(int value) {
if (camera.moving())
{
camera.moveX();
camera.moveZ();
camera.moveY();
glutPostRedisplay(); //Tell GLUT that the scene has changed
}
//Tell GLUT to call update again in 25 milliseconds
glutTimerFunc(25, update, 0);
}
It is a very simple program. The main thing is that rendering is never done unless there is something to render. The timer simply ensures that framerate stays low.
I imagine something like this is possible with SFML, however it isn't with the way the tutorial code is presented, basically:
bool Running = true;
while (Running)
{
App.Display();
}
We can limit framerate, but this still doesn't solve the fact that if nothing is happening, the frame shouldn't be updated.