From: Sylvain Beucler Date: Sat, 9 Jun 2012 17:49:27 +0000 (+0000) Subject: Make glutInitContextFunc/glutPauseFunc/glutResumeFunc names definitive (+ reference... X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=5e0c2363eddcc91af3574ea5777e686e8998e390;p=freeglut Make glutInitContextFunc/glutPauseFunc/glutResumeFunc names definitive (+ reference them in the .def) git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1335 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/include/GL/freeglut_ext.h b/include/GL/freeglut_ext.h index 0800345..0597c0f 100644 --- a/include/GL/freeglut_ext.h +++ b/include/GL/freeglut_ext.h @@ -230,9 +230,9 @@ FGAPI void FGAPIENTRY glutSetVertexAttribCoord3(GLint attrib); FGAPI void FGAPIENTRY glutSetVertexAttribNormal(GLint attrib); /* Mobile platforms lifecycle */ -FGAPI void FGAPIENTRY glutFixMyNameInitContextFunc(void (* callback)()); -FGAPI void FGAPIENTRY glutFixMyNamePauseFunc(void (* callback)()); -FGAPI void FGAPIENTRY glutFixMyNameResumeFunc(void (* callback)()); +FGAPI void FGAPIENTRY glutInitContextFunc(void (* callback)()); +FGAPI void FGAPIENTRY glutPauseFunc(void (* callback)()); +FGAPI void FGAPIENTRY glutResumeFunc(void (* callback)()); /* * GLUT API macro definitions -- the display mode definitions diff --git a/progs/test-shapes-gles1/test-shapes-gles1.c b/progs/test-shapes-gles1/test-shapes-gles1.c index ab26593..d55e0c6 100644 --- a/progs/test-shapes-gles1/test-shapes-gles1.c +++ b/progs/test-shapes-gles1/test-shapes-gles1.c @@ -322,7 +322,7 @@ main(int argc, char *argv[]) glutSpecialFunc(special); glutIdleFunc(idle); glutMouseFunc(onMouseClick); - glutFixMyNameInitContextFunc(init_context); + glutInitContextFunc(init_context); glutSetOption ( GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_CONTINUE_EXECUTION ) ; diff --git a/src/android/fg_main_android.c b/src/android/fg_main_android.c index 84513a6..09406d5 100644 --- a/src/android/fg_main_android.c +++ b/src/android/fg_main_android.c @@ -368,7 +368,7 @@ void handle_cmd(struct android_app* app, int32_t cmd) { /* The application is being hidden, but may be restored */ LOGI("handle_cmd: APP_CMD_TERM_WINDOW"); fghPlatformCloseWindowEGL(window); - window->State.NeedToFixMyNameInitContext = GL_TRUE; + window->State.NeedToInitContext = GL_TRUE; fgDisplay.pDisplay.single_native_window = NULL; break; case APP_CMD_STOP: @@ -474,8 +474,8 @@ void fgPlatformProcessSingleEvent ( void ) fgPlatformOpenWindow(window, "", GL_FALSE, 0, 0, GL_FALSE, 0, 0, GL_FALSE, GL_FALSE); /* TODO: INVOKE_WCB(*window, Pause?); */ /* TODO: INVOKE_WCB(*window, Resume?); */ - if (!FETCH_WCB(*window, FixMyNameInitContext) - fgWarning("Resuming application, but no callback to reload context resources (glutFixMyNameInitContextFunc)"); + if (!FETCH_WCB(*window, InitContext)) + fgWarning("Resuming application, but no callback to reload context resources (glutInitContextFunc)"); } } } diff --git a/src/fg_callbacks.c b/src/fg_callbacks.c index b3e2917..6eff0bf 100644 --- a/src/fg_callbacks.c +++ b/src/fg_callbacks.c @@ -412,28 +412,28 @@ void FGAPIENTRY glutMultiPassiveFunc( void (* callback)(int, int, int ) ) /* * Sets the context reload callback for the current window */ -void FGAPIENTRY glutFixMyNameInitContextFunc( void (* callback)() ) +void FGAPIENTRY glutInitContextFunc( void (* callback)() ) { - FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutFixMyNameInitContextFunc" ); - SET_CALLBACK( FixMyNameInitContext ); + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutInitContextFunc" ); + SET_CALLBACK( InitContext ); } /* * Sets the pause callback for the current window */ -void FGAPIENTRY glutFixMyNamePauseFunc( void (* callback)() ) +void FGAPIENTRY glutPauseFunc( void (* callback)() ) { - FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutFixMyNamePauseFunc" ); - SET_CALLBACK( FixMyNamePause ); + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutPauseFunc" ); + SET_CALLBACK( Pause ); } /* * Sets the resume callback for the current window */ -void FGAPIENTRY glutFixMyNameResumeFunc( void (* callback)() ) +void FGAPIENTRY glutResumeFunc( void (* callback)() ) { - FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutFixMyNameResumeFunc" ); - SET_CALLBACK( FixMyNameResume ); + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutResumeFunc" ); + SET_CALLBACK( Resume ); } /*** END OF FILE ***/ diff --git a/src/fg_ext.c b/src/fg_ext.c index 293fa62..beadca3 100644 --- a/src/fg_ext.c +++ b/src/fg_ext.c @@ -199,9 +199,9 @@ static GLUTproc fghGetGLUTProcAddress( const char* procName ) CHECK_NAME(glutInitContextProfile); CHECK_NAME(glutInitErrorFunc); CHECK_NAME(glutInitWarningFunc); - CHECK_NAME(glutFixMyNameInitContextFunc) - CHECK_NAME(glutFixMyNamePauseFunc) - CHECK_NAME(glutFixMyNameResumeFunc) + CHECK_NAME(glutInitContextFunc) + CHECK_NAME(glutPauseFunc) + CHECK_NAME(glutResumeFunc) #undef CHECK_NAME return NULL; diff --git a/src/fg_internal.h b/src/fg_internal.h index dbae676..13e57a3 100644 --- a/src/fg_internal.h +++ b/src/fg_internal.h @@ -219,9 +219,9 @@ typedef void (* FGCBMultiButton )( int, int, int, int, int ); typedef void (* FGCBMultiMotion )( int, int, int ); typedef void (* FGCBMultiPassive )( int, int, int ); -typedef void (* FGCBFixMyNameInitContext)(); -typedef void (* FGCBFixMyNamePause)(); -typedef void (* FGCBFixMyNameResume)(); +typedef void (* FGCBInitContext)(); +typedef void (* FGCBPause)(); +typedef void (* FGCBResume)(); /* The global callbacks type definitions */ typedef void (* FGCBIdle )( void ); @@ -402,7 +402,7 @@ struct tagSFG_WindowState GLboolean IsFullscreen; /* is the window fullscreen? */ - GLboolean NeedToFixMyNameInitContext; /* are OpenGL context/resources loaded? */ + GLboolean NeedToInitContext; /* are OpenGL context/resources loaded? */ }; @@ -535,9 +535,9 @@ enum CB_MultiPassive, /* Mobile platforms LifeCycle */ - CB_FixMyNameInitContext, - CB_FixMyNamePause, - CB_FixMyNameResume, + CB_InitContext, + CB_Pause, + CB_Resume, /* Presently ignored */ CB_Select, diff --git a/src/fg_main.c b/src/fg_main.c index 33ca857..99040af 100644 --- a/src/fg_main.c +++ b/src/fg_main.c @@ -105,9 +105,9 @@ void fghRedrawWindow ( SFG_Window *window ) freeglut_return_if_fail( window ); - if( window->State.NeedToFixMyNameInitContext ) { - INVOKE_WCB( *window, FixMyNameInitContext, ()); - window->State.NeedToFixMyNameInitContext = GL_FALSE; + if( window->State.NeedToInitContext ) { + INVOKE_WCB( *window, InitContext, ()); + window->State.NeedToInitContext = GL_FALSE; } freeglut_return_if_fail( FETCH_WCB ( *window, Display ) ); diff --git a/src/fg_window.c b/src/fg_window.c index efbae89..9760858 100644 --- a/src/fg_window.c +++ b/src/fg_window.c @@ -151,7 +151,7 @@ void fgOpenWindow( SFG_Window* window, const char* title, fgInitGL2(); - window->State.NeedToFixMyNameInitContext = GL_TRUE; + window->State.NeedToInitContext = GL_TRUE; } /* diff --git a/src/freeglutdll.def.in b/src/freeglutdll.def.in index d038c70..9b55b74 100644 --- a/src/freeglutdll.def.in +++ b/src/freeglutdll.def.in @@ -152,3 +152,6 @@ EXPORTS glutMultiEntryFunc glutMultiMotionFunc glutMultiPassiveFunc + glutInitContextFunc + glutPauseFunc + glutResumeFunc