Making the "AT_EXIT" hack look a bit less like a copy-and-paste
[freeglut] / src / freeglut_window.c
index 005074b..7b73146 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"
 
@@ -1092,6 +1093,14 @@ int FGAPIENTRY glutCreateWindow( const char* title )
                            GL_FALSE, GL_FALSE )->ID;
 }
 
+#ifdef _WIN32
+int FGAPIENTRY __glutCreateWindowWithExit( const char *title, void (__cdecl *exit_function)(int) )
+{
+  __glutExitFunc = exit_function;
+  return glutCreateWindow( title );
+}
+#endif
+
 /*
  * This function creates a sub window.
  */