Fixing the "fgDeinitialize" call properly per e-mail from John Tsiombikas dated 12...
[freeglut] / src / freeglut_menu.c
index a96f5d6..ea5837e 100644 (file)
@@ -25,6 +25,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
+#define FREEGLUT_BUILDING_LIB
 #include <GL/freeglut.h>
 #include "freeglut_internal.h"
 
@@ -778,6 +779,14 @@ int FGAPIENTRY glutCreateMenu( void(* callback)( int ) )
     return fgCreateMenu( callback )->ID;
 }
 
+#if TARGET_HOST_MS_WINDOWS
+int FGAPIENTRY __glutCreateMenuWithExit( void(* callback)( int ), void (__cdecl *exit_function)(int) )
+{
+  __glutExitFunc = exit_function;
+  return glutCreateMenu( callback );
+}
+#endif
+
 /*
  * Destroys a menu object, removing all references to it
  */