Exiting a window under GLUT

I have been using the [ESC] key to exit my glut based programs.
Is there a glut event command for a windows signals like mouse click on the X box to close.

I’m pretty sure there isn’t (I mean, GLUT kills your app once you click the X button).

Check out GLFW instead: http://hem.passagen.se/opengl/glfw/

It can detect the window being closed. See the included docs and examples for how it works.

Note: There is a difference between how it works under Windows and how it works under X11. Under X11 the ‘X’ button normally means “kill application”, not “close window”.

The problem I am having is when I close the window with the X button, the windows closes but the program keeps running in the background. Then I have to kill it, to get it to exit.

Originally posted by marcus256:
[b]I’m pretty sure there isn’t (I mean, GLUT kills your app once you click the X button).

Check out GLFW instead: http://hem.passagen.se/opengl/glfw/

It can detect the window being closed. See the included docs and examples for how it works.

Note: There is a difference between how it works under Windows and how it works under X11. Under X11 the ‘X’ button normally means “kill application”, not “close window”.[/b]