• Advertisement

Archived

This topic is now archived and is closed to further replies.

Glut exit callback?

This topic is 6226 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
Short answer No.
But check: http://www.opengl.org/developers/faqs/technical/glut.htm#glot0090

Mvh
Søren Olesen

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement