instead of separate Pause and Resume CBs, we now have a AppStatus CB which passes...
authorDiederick Niehorster <dcnieho@gmail.com>
Thu, 4 Apr 2013 10:54:44 +0000 (10:54 +0000)
committerDiederick Niehorster <dcnieho@gmail.com>
Thu, 4 Apr 2013 10:54:44 +0000 (10:54 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1586 7f0cb862-5218-0410-a997-914c9d46530a

include/GL/freeglut_ext.h
src/android/fg_main_android.c
src/fg_callbacks.c
src/fg_ext.c
src/fg_internal.h
src/freeglutdll.def.in

index 3826e46..5b8422d 100644 (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
index ce3f585..4c862f5 100644 (file)
@@ -437,7 +437,7 @@ void fgPlatformProcessSingleEvent ( void )
   /* If we're not in RESUME state, Android paused us, so wait */\r
   struct android_app* app = fgDisplay.pDisplay.app;\r
   if (app->destroyRequested != 1 && app->activityState != APP_CMD_RESUME) {\r
-      INVOKE_WCB(*window, Pause, ());\r
+      INVOKE_WCB(*window, AppStatus, (GLUT_APPSTATUS_PAUSE));\r
 \r
     int FOREVER = -1;\r
     while (app->destroyRequested != 1 && (app->activityState != APP_CMD_RESUME)) {\r
@@ -472,7 +472,7 @@ void fgPlatformProcessSingleEvent ( void )
           fgWarning("Resuming application, but no callback to reload context resources (glutInitContextFunc)");\r
     }\r
 \r
-    INVOKE_WCB(*window, Resume, ());\r
+    INVOKE_WCB(*window, AppStatus, (GLUT_APPSTATUS_RESUME));\r
   }\r
 }\r
 \r
index c62d37c..7c82c81 100644 (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);
 
 
 
index 8432232..6835854 100644 (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;
index 1b671c3..6974dd3 100644 (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,
index bb2c75e..988d7d3 100644 (file)
@@ -159,8 +159,7 @@ EXPORTS
        glutMultiMotionFunc
        glutMultiPassiveFunc
     glutInitContextFunc
-    glutPauseFunc
-    glutResumeFunc
+    glutAppStatusFunc
     glutSetVertexAttribCoord3
     glutSetVertexAttribNormal
     glutSetVertexAttribTexCoord2