I think that we can call glutPostRedisplay only in a callback function
Yes that is what I implicitly mean, but where are you likely to modify data if not in a callback? I mean, the user could change data, using keyboard, mouse, or the program itself at regular intervals and there are callbacks to handle all these cases. But you can not register a new callback with glut and I don’t know if you can handle correctly things like animation with only a idle function. Look at other libraries like GLFW which is more turned toward games. There is also Qt which I think is the best for this kind of things (thinking of application portability).