diff --git a/freeglut/freeglut/src/Common/freeglut_internal.h b/freeglut/freeglut/src/Common/freeglut_internal.h index f4fc756..e4b9d8f 100644 --- a/freeglut/freeglut/src/Common/freeglut_internal.h +++ b/freeglut/freeglut/src/Common/freeglut_internal.h @@ -991,10 +991,6 @@ int fgHintPresent(Window window, Atom property, Atom hint); SFG_Proc fghGetProcAddress( const char *procName ); -#if TARGET_HOST_MS_WINDOWS -extern void (__cdecl *__glutExitFunc)( int return_value ); -#endif - #endif /* FREEGLUT_INTERNAL_H */ /*** END OF FILE ***/ diff --git a/freeglut/freeglut/src/Common/freeglut_window.c b/freeglut/freeglut/src/Common/freeglut_window.c index 1468627..cde6407 100644 --- a/freeglut/freeglut/src/Common/freeglut_window.c +++ b/freeglut/freeglut/src/Common/freeglut_window.c @@ -986,14 +986,6 @@ int FGAPIENTRY glutCreateWindow( const char* title ) GL_FALSE, GL_FALSE )->ID; } -#if TARGET_HOST_MS_WINDOWS -int FGAPIENTRY __glutCreateWindowWithExit( const char *title, void (__cdecl *exit_function)(int) ) -{ - __glutExitFunc = exit_function; - return glutCreateWindow( title ); -} -#endif - /* * This function creates a sub window. */ diff --git a/freeglut/freeglut/src/mswin/freeglut_internal_mswin.h b/freeglut/freeglut/src/mswin/freeglut_internal_mswin.h index 628c06d..c83f231 100644 --- a/freeglut/freeglut/src/mswin/freeglut_internal_mswin.h +++ b/freeglut/freeglut/src/mswin/freeglut_internal_mswin.h @@ -49,6 +49,8 @@ struct tagSFG_PlatformContext }; +/* Function to be called on exit */ +extern void (__cdecl *__glutExitFunc)( int return_value ); #endif /* FREEGLUT_INTERNAL_MSWIN_H */ \ No newline at end of file diff --git a/freeglut/freeglut/src/mswin/freeglut_window_mswin.c b/freeglut/freeglut/src/mswin/freeglut_window_mswin.c index 583d5f7..5a33ec5 100644 --- a/freeglut/freeglut/src/mswin/freeglut_window_mswin.c +++ b/freeglut/freeglut/src/mswin/freeglut_window_mswin.c @@ -1078,3 +1078,12 @@ void fgPlatformGlutFullScreenToggle( SFG_Window *win ) } +/* -- PLATFORM-SPECIFIC INTERFACE FUNCTION -------------------------------------------------- */ + + +int FGAPIENTRY __glutCreateWindowWithExit( const char *title, void (__cdecl *exit_function)(int) ) +{ + __glutExitFunc = exit_function; + return glutCreateWindow( title ); +} +