instead of separate Pause and Resume CBs, we now have a AppStatus CB which passes flags to indicate which state was entered. more extensible

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1586 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
dcnieho 2013-04-04 10:54:44 +00:00
parent 753f2f1163
commit a66dc9389e
6 changed files with 15 additions and 18 deletions

View File

@ -250,8 +250,10 @@ FGAPI void FGAPIENTRY glutSetVertexAttribTexCoord2(GLint attrib);
/* Mobile platforms lifecycle */
FGAPI void FGAPIENTRY glutInitContextFunc(void (* callback)());
FGAPI void FGAPIENTRY glutPauseFunc(void (* callback)());
FGAPI void FGAPIENTRY glutResumeFunc(void (* callback)());
FGAPI void FGAPIENTRY glutAppStatusFunc(void (* callback)(int));
/* state flags that can be passed to callback set by glutAppStatusFunc */
#define GLUT_APPSTATUS_PAUSE 0x0001
#define GLUT_APPSTATUS_RESUME 0x0002
/*
* GLUT API macro definitions -- the display mode definitions

View File

@ -437,7 +437,7 @@ void fgPlatformProcessSingleEvent ( void )
/* If we're not in RESUME state, Android paused us, so wait */
struct android_app* app = fgDisplay.pDisplay.app;
if (app->destroyRequested != 1 && app->activityState != APP_CMD_RESUME) {
INVOKE_WCB(*window, Pause, ());
INVOKE_WCB(*window, AppStatus, (GLUT_APPSTATUS_PAUSE));
int FOREVER = -1;
while (app->destroyRequested != 1 && (app->activityState != APP_CMD_RESUME)) {
@ -472,7 +472,7 @@ void fgPlatformProcessSingleEvent ( void )
fgWarning("Resuming application, but no callback to reload context resources (glutInitContextFunc)");
}
INVOKE_WCB(*window, Resume, ());
INVOKE_WCB(*window, AppStatus, (GLUT_APPSTATUS_RESUME));
}
}

View File

@ -145,8 +145,7 @@ IMPLEMENT_CALLBACK_FUNC(MultiButton);
IMPLEMENT_CALLBACK_FUNC(MultiMotion);
IMPLEMENT_CALLBACK_FUNC(MultiPassive);
IMPLEMENT_CALLBACK_FUNC(InitContext);
IMPLEMENT_CALLBACK_FUNC(Pause);
IMPLEMENT_CALLBACK_FUNC(Resume);
IMPLEMENT_CALLBACK_FUNC(AppStatus);

View File

@ -203,12 +203,11 @@ static GLUTproc fghGetGLUTProcAddress( const char* procName )
CHECK_NAME(glutInitContextProfile);
CHECK_NAME(glutInitErrorFunc);
CHECK_NAME(glutInitWarningFunc);
CHECK_NAME(glutInitContextFunc)
CHECK_NAME(glutPauseFunc)
CHECK_NAME(glutResumeFunc)
CHECK_NAME(glutSetVertexAttribCoord3)
CHECK_NAME(glutSetVertexAttribNormal)
CHECK_NAME(glutSetVertexAttribTexCoord2)
CHECK_NAME(glutInitContextFunc);
CHECK_NAME(glutAppStatusFunc);
CHECK_NAME(glutSetVertexAttribCoord3);
CHECK_NAME(glutSetVertexAttribNormal);
CHECK_NAME(glutSetVertexAttribTexCoord2);
#undef CHECK_NAME
return NULL;

View File

@ -220,8 +220,7 @@ typedef void (* FGCBMultiMotion )( int, int, int );
typedef void (* FGCBMultiPassive )( int, int, int );
typedef void (* FGCBInitContext)();
typedef void (* FGCBPause)();
typedef void (* FGCBResume)();
typedef void (* FGCBAppStatus)(int);
/* The global callbacks type definitions */
typedef void (* FGCBIdle )( void );
@ -602,8 +601,7 @@ enum
/* Mobile platforms LifeCycle */
WCB_InitContext,
WCB_Pause,
WCB_Resume,
WCB_AppStatus,
/* Presently ignored */
WCB_Select,

View File

@ -159,8 +159,7 @@ EXPORTS
glutMultiMotionFunc
glutMultiPassiveFunc
glutInitContextFunc
glutPauseFunc
glutResumeFunc
glutAppStatusFunc
glutSetVertexAttribCoord3
glutSetVertexAttribNormal
glutSetVertexAttribTexCoord2