X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;ds=inline;f=src%2Fandroid%2Ffg_main_android.c;h=1fa41d62c4d64f6004cebe68dc1b0c9c408358ea;hb=a00c7ee3552b527ac6b375d6a6ca42f90770ddc3;hp=ce3f58540f1314b598cdb424bbceb125cd9bc16b;hpb=99d53f15a4216240088132f6af9cb194b519b1cc;p=freeglut diff --git a/src/android/fg_main_android.c b/src/android/fg_main_android.c index ce3f585..1fa41d6 100644 --- a/src/android/fg_main_android.c +++ b/src/android/fg_main_android.c @@ -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)); } } @@ -495,6 +495,8 @@ void fgPlatformProcessWork(SFG_Window *window) /* Now clear it so that any callback generated by the actions below can set work again */ window->State.WorkMask = 0; + if (workMask&~GLUT_DISPLAY_WORK) /* Display work is the common case, skip all the below at once */ + { /* This is before the first display callback: call a few callbacks to inform user of window size, position, etc * we know this is before the first display callback of a window as for all windows GLUT_INIT_WORK is set when * they are opened, and work is done before displaying in the mainloop. @@ -562,5 +564,15 @@ void fgPlatformProcessWork(SFG_Window *window) break; } } + } + + if (workMask & GLUT_DISPLAY_WORK) + { + if( window->State.Visible ) + fghRedrawWindow ( window ); + + /* Strip out display work that might have ended up on work list now as some of the above genereates callbacks */ + window->State.WorkMask &= ~GLUT_DISPLAY_WORK; + } }