Make glutInitContextFunc/glutPauseFunc/glutResumeFunc names definitive (+ reference them in the .def)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1335 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
beuc 2012-06-09 17:49:27 +00:00
parent 4d5e90860d
commit 6ea4bc321e
9 changed files with 33 additions and 30 deletions

View File

@ -230,9 +230,9 @@ FGAPI void FGAPIENTRY glutSetVertexAttribCoord3(GLint attrib);
FGAPI void FGAPIENTRY glutSetVertexAttribNormal(GLint attrib); FGAPI void FGAPIENTRY glutSetVertexAttribNormal(GLint attrib);
/* Mobile platforms lifecycle */ /* Mobile platforms lifecycle */
FGAPI void FGAPIENTRY glutFixMyNameInitContextFunc(void (* callback)()); FGAPI void FGAPIENTRY glutInitContextFunc(void (* callback)());
FGAPI void FGAPIENTRY glutFixMyNamePauseFunc(void (* callback)()); FGAPI void FGAPIENTRY glutPauseFunc(void (* callback)());
FGAPI void FGAPIENTRY glutFixMyNameResumeFunc(void (* callback)()); FGAPI void FGAPIENTRY glutResumeFunc(void (* callback)());
/* /*
* GLUT API macro definitions -- the display mode definitions * GLUT API macro definitions -- the display mode definitions

View File

@ -322,7 +322,7 @@ main(int argc, char *argv[])
glutSpecialFunc(special); glutSpecialFunc(special);
glutIdleFunc(idle); glutIdleFunc(idle);
glutMouseFunc(onMouseClick); glutMouseFunc(onMouseClick);
glutFixMyNameInitContextFunc(init_context); glutInitContextFunc(init_context);
glutSetOption ( GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_CONTINUE_EXECUTION ) ; glutSetOption ( GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_CONTINUE_EXECUTION ) ;

View File

@ -368,7 +368,7 @@ void handle_cmd(struct android_app* app, int32_t cmd) {
/* The application is being hidden, but may be restored */ /* The application is being hidden, but may be restored */
LOGI("handle_cmd: APP_CMD_TERM_WINDOW"); LOGI("handle_cmd: APP_CMD_TERM_WINDOW");
fghPlatformCloseWindowEGL(window); fghPlatformCloseWindowEGL(window);
window->State.NeedToFixMyNameInitContext = GL_TRUE; window->State.NeedToInitContext = GL_TRUE;
fgDisplay.pDisplay.single_native_window = NULL; fgDisplay.pDisplay.single_native_window = NULL;
break; break;
case APP_CMD_STOP: 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); fgPlatformOpenWindow(window, "", GL_FALSE, 0, 0, GL_FALSE, 0, 0, GL_FALSE, GL_FALSE);
/* TODO: INVOKE_WCB(*window, Pause?); */ /* TODO: INVOKE_WCB(*window, Pause?); */
/* TODO: INVOKE_WCB(*window, Resume?); */ /* TODO: INVOKE_WCB(*window, Resume?); */
if (!FETCH_WCB(*window, FixMyNameInitContext) if (!FETCH_WCB(*window, InitContext))
fgWarning("Resuming application, but no callback to reload context resources (glutFixMyNameInitContextFunc)"); fgWarning("Resuming application, but no callback to reload context resources (glutInitContextFunc)");
} }
} }
} }

View File

@ -412,28 +412,28 @@ void FGAPIENTRY glutMultiPassiveFunc( void (* callback)(int, int, int ) )
/* /*
* Sets the context reload callback for the current window * 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" ); FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutInitContextFunc" );
SET_CALLBACK( FixMyNameInitContext ); SET_CALLBACK( InitContext );
} }
/* /*
* Sets the pause callback for the current window * Sets the pause callback for the current window
*/ */
void FGAPIENTRY glutFixMyNamePauseFunc( void (* callback)() ) void FGAPIENTRY glutPauseFunc( void (* callback)() )
{ {
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutFixMyNamePauseFunc" ); FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutPauseFunc" );
SET_CALLBACK( FixMyNamePause ); SET_CALLBACK( Pause );
} }
/* /*
* Sets the resume callback for the current window * Sets the resume callback for the current window
*/ */
void FGAPIENTRY glutFixMyNameResumeFunc( void (* callback)() ) void FGAPIENTRY glutResumeFunc( void (* callback)() )
{ {
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutFixMyNameResumeFunc" ); FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutResumeFunc" );
SET_CALLBACK( FixMyNameResume ); SET_CALLBACK( Resume );
} }
/*** END OF FILE ***/ /*** END OF FILE ***/

View File

@ -199,9 +199,9 @@ static GLUTproc fghGetGLUTProcAddress( const char* procName )
CHECK_NAME(glutInitContextProfile); CHECK_NAME(glutInitContextProfile);
CHECK_NAME(glutInitErrorFunc); CHECK_NAME(glutInitErrorFunc);
CHECK_NAME(glutInitWarningFunc); CHECK_NAME(glutInitWarningFunc);
CHECK_NAME(glutFixMyNameInitContextFunc) CHECK_NAME(glutInitContextFunc)
CHECK_NAME(glutFixMyNamePauseFunc) CHECK_NAME(glutPauseFunc)
CHECK_NAME(glutFixMyNameResumeFunc) CHECK_NAME(glutResumeFunc)
#undef CHECK_NAME #undef CHECK_NAME
return NULL; return NULL;

View File

@ -219,9 +219,9 @@ typedef void (* FGCBMultiButton )( int, int, int, int, int );
typedef void (* FGCBMultiMotion )( int, int, int ); typedef void (* FGCBMultiMotion )( int, int, int );
typedef void (* FGCBMultiPassive )( int, int, int ); typedef void (* FGCBMultiPassive )( int, int, int );
typedef void (* FGCBFixMyNameInitContext)(); typedef void (* FGCBInitContext)();
typedef void (* FGCBFixMyNamePause)(); typedef void (* FGCBPause)();
typedef void (* FGCBFixMyNameResume)(); typedef void (* FGCBResume)();
/* The global callbacks type definitions */ /* The global callbacks type definitions */
typedef void (* FGCBIdle )( void ); typedef void (* FGCBIdle )( void );
@ -402,7 +402,7 @@ struct tagSFG_WindowState
GLboolean IsFullscreen; /* is the window fullscreen? */ 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, CB_MultiPassive,
/* Mobile platforms LifeCycle */ /* Mobile platforms LifeCycle */
CB_FixMyNameInitContext, CB_InitContext,
CB_FixMyNamePause, CB_Pause,
CB_FixMyNameResume, CB_Resume,
/* Presently ignored */ /* Presently ignored */
CB_Select, CB_Select,

View File

@ -105,9 +105,9 @@ void fghRedrawWindow ( SFG_Window *window )
freeglut_return_if_fail( window ); freeglut_return_if_fail( window );
if( window->State.NeedToFixMyNameInitContext ) { if( window->State.NeedToInitContext ) {
INVOKE_WCB( *window, FixMyNameInitContext, ()); INVOKE_WCB( *window, InitContext, ());
window->State.NeedToFixMyNameInitContext = GL_FALSE; window->State.NeedToInitContext = GL_FALSE;
} }
freeglut_return_if_fail( FETCH_WCB ( *window, Display ) ); freeglut_return_if_fail( FETCH_WCB ( *window, Display ) );

View File

@ -151,7 +151,7 @@ void fgOpenWindow( SFG_Window* window, const char* title,
fgInitGL2(); fgInitGL2();
window->State.NeedToFixMyNameInitContext = GL_TRUE; window->State.NeedToInitContext = GL_TRUE;
} }
/* /*

View File

@ -152,3 +152,6 @@ EXPORTS
glutMultiEntryFunc glutMultiEntryFunc
glutMultiMotionFunc glutMultiMotionFunc
glutMultiPassiveFunc glutMultiPassiveFunc
glutInitContextFunc
glutPauseFunc
glutResumeFunc