redisplay is now also on the work list instead of handled separately
[freeglut] / src / android / fg_main_android.c
index 4c862f5..1fa41d6 100644 (file)
@@ -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 */\r
     window->State.WorkMask = 0;\r
 \r
+    if (workMask&~GLUT_DISPLAY_WORK)    /* Display work is the common case, skip all the below at once */\r
+    {\r
     /* This is before the first display callback: call a few callbacks to inform user of window size, position, etc\r
      * we know this is before the first display callback of a window as for all windows GLUT_INIT_WORK is set when\r
      * they are opened, and work is done before displaying in the mainloop.\r
@@ -562,5 +564,15 @@ void fgPlatformProcessWork(SFG_Window *window)
             break;\r
         }\r
     }\r
+    }\r
+\r
+    if (workMask & GLUT_DISPLAY_WORK)\r
+    {\r
+        if( window->State.Visible )\r
+            fghRedrawWindow ( window );\r
+\r
+        /* Strip out display work that might have ended up on work list now as some of the above genereates callbacks */\r
+        window->State.WorkMask &= ~GLUT_DISPLAY_WORK;\r
+    }\r
 }\r
 \r