From d59e23ba2e83c9d0b1e7b7b04798a21adc26fdca Mon Sep 17 00:00:00 2001 From: fayjf Date: Sun, 29 Jan 2012 03:22:28 +0000 Subject: [PATCH] Moving the "glutCreateWindowWithExit" and its associated variable to the Windows-specific files git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1015 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/Common/freeglut_internal.h | 4 ---- freeglut/freeglut/src/Common/freeglut_window.c | 8 -------- freeglut/freeglut/src/mswin/freeglut_internal_mswin.h | 2 ++ freeglut/freeglut/src/mswin/freeglut_window_mswin.c | 9 +++++++++ 4 files changed, 11 insertions(+), 12 deletions(-) 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 ); +} +