diff --git a/freeglut/web-src/docs/api.php b/freeglut/web-src/docs/api.php index 3b65981..75ba821 100644 --- a/freeglut/web-src/docs/api.php +++ b/freeglut/web-src/docs/api.php @@ -888,19 +888,26 @@ about to be destroyed.

The glutCloseFunc function specifies the function -that freeglut will call when a window is about to be closed, -either because it is requested using glutDestroyWindow, -because the user clicked on the "x" in the window header -(for top-level windows only), or due to a pending closure of a -subwindow's parent window. In the first case, the closure callback +that freeglut will call to notify the application that a window +is about to be closed, either because it is requested using +glutDestroyWindow, because the user clicked on the "x" in the +window header (for top-level windows only), or due to a pending closure +of a subwindow's parent window. In the first case, the closure callback is not invoked from the glutDestroyWindow call, but at a -later time point. +later time point.
Freeglut sets the current window to the window -which is about to be closed when the callback is invoked. +which is about to be closed when the callback is invoked. The window can +thus be retrieved in the callback using glutGetWindow.
Please note that other further developments of GLUT provide a glutWMCloseFunc. For compatibility, FreeGLUT also provides this function. It is however an alias to -glutCloseFunc. +glutCloseFunc. Users looking to prevent FreeGLUT from +exiting when a window is closed, as was made possible with +glutWMCloseFunc by that callback's designer should look into +using glutSetOption to set GLUT_ACTION_ON_WINDOW_CLOSE to +GLUT_ACTION_GLUTMAINLOOP_RETURNS or +GLUT_ACTION_CONTINUE_EXECUTION. This will prevent the +application from exiting when a window is closed.

Changes From GLUT