exitting in GLUT

I’ve got a problem that my program SHOULD do some cleanup before it gets terminated.

The function should be called just after glutmainloop has ended, but glutmainloop normally shuts down the whole task!
What can I do about it? Help!

Originally posted by szucst:
[b]I’ve got a problem that my program SHOULD do some cleanup before it gets terminated.

The function should be called just after glutmainloop has ended, but glutmainloop normally shuts down the whole task!
What can I do about it? Help![/b]

http://www.mathies.com/glfaq/

Fixing GLUT’s “X” button close window exit() bug

Hi,

Go to my web pages and get a fixed glut
which provides glutWMCloseFunc() which
allows you to register a callback which is activated when the windows “X” close button
is pressed (as well as in response to the XWindows ClientMessage).
http://www-users.york.ac.uk/~rpf1/glut/

(See ~rpf1/glut.html for info )

Rob

thanks!