Skip to main content
GameDev.net gamedev.net
🔒 Locked

Glut exit callback?

Started by rileyriley Jan 4, 2001 at 6:39 PM 1 replies 7.7k views
Original Post
rileyriley
rileyriley
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
soreno
soreno
Short answer No.
But check: http://www.opengl.org/developers/faqs/technical/glut.htm#glot0090

Mvh
Søren Olesen
Protozone
Protozone
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.