From 481216ae30a9f573a56774fd7d8a300ab76d7189 Mon Sep 17 00:00:00 2001 From: "John F. Fay" 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: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1015 7f0cb862-5218-0410-a997-914c9d46530a --- src/Common/freeglut_internal.h | 4 ---- src/Common/freeglut_window.c | 8 -------- src/mswin/freeglut_internal_mswin.h | 2 ++ src/mswin/freeglut_window_mswin.c | 9 +++++++++ 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/Common/freeglut_internal.h b/src/Common/freeglut_internal.h index f4fc756..e4b9d8f 100644 --- a/src/Common/freeglut_internal.h +++ b/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/src/Common/freeglut_window.c b/src/Common/freeglut_window.c index 1468627..cde6407 100644 --- a/src/Common/freeglut_window.c +++ b/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/src/mswin/freeglut_internal_mswin.h b/src/mswin/freeglut_internal_mswin.h index 628c06d..c83f231 100644 --- a/src/mswin/freeglut_internal_mswin.h +++ b/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/src/mswin/freeglut_window_mswin.c b/src/mswin/freeglut_window_mswin.c index 583d5f7..5a33ec5 100644 --- a/src/mswin/freeglut_window_mswin.c +++ b/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 ); +} + -- 1.7.10.4