I want to be able to use OpenGL to create a video output file instead of the usual display on screen output. I am thinking by not using glutPostRedisplay() or (SFML version, which is something like this:) window.Display(), and somehow using glReadPixels() instead.
glReadPixels puts the pixel content into an array in memory (as you might already know) but how can I convert that into a frame, and string several frames together in a video file? And what format would the video file be in, so that I can play it?
I should explain why I want to do this: A lot of physics simulations can take a very long time to calculate enough information to display one frame, so it's better to leave it running overnight and play the video file the next morning. You wouldn't want to keep coming back every 5 minutes to see what had happened.