I want to be able to clean up after my program when the user exits (I''m using glut on a mac). When they click the close button on the window, the program just up and exits, with no warning. I put some code under the call to glutMainLoop but it never gets run.
Is there a function like glutExitFunc(callback) that I can use to clean up after my program when the user closes the window?
Thanks for any help.