Glut exit callback?

Started by
1 comment, last by rileyriley 23 years, 3 months ago
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. /riley
--Riley
Advertisement
Short answer No.
But check: http://www.opengl.org/developers/faqs/technical/glut.htm#glot0090

Mvh
Søren Olesen
Before calling glutMainLoop(), make a call to atexit(func_to_be_called);
where "func_to_be_called" is the function you want to be called just before your program exits.
Cheers.
Protozone

This topic is closed to new replies.

Advertisement