/* 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
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
}\r
\r
\r
-/* Step through the work list */\r
-void fgPlatformProcessWork(SFG_Window *window)\r
+/* deal with work list items */\r
+void fgPlatformInitWork(SFG_Window* window)\r
{\r
- unsigned int workMask = window->State.WorkMask;\r
- /* Now clear it so that any callback generated by the actions below can set work again */\r
- window->State.WorkMask = 0;\r
+ /* notify windowStatus/visibility */\r
+ INVOKE_WCB( *window, WindowStatus, ( GLUT_FULLY_RETAINED ) );\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
+ /* Position callback, always at 0,0 */\r
+ fghOnPositionNotify(window, 0, 0, GL_TRUE);\r
+\r
+ /* Size gets notified on window creation with size detection in mainloop above\r
+ * XXX CHECK: does this messages happen too early like on windows,\r
+ * so client code cannot have registered a callback yet and the message\r
+ * is thus never received by client?\r
*/\r
- if (workMask & GLUT_INIT_WORK)\r
- {\r
- /* notify windowStatus/visibility */\r
- INVOKE_WCB( *window, WindowStatus, ( GLUT_FULLY_RETAINED ) );\r
-\r
- /* Position callback, always at 0,0 */\r
- fghOnPositionNotify(window, 0, 0, GL_TRUE);\r
-\r
- /* Size gets notified on window creation with size detection in mainloop above\r
- * XXX CHECK: does this messages happen too early like on windows,\r
- * so client code cannot have registered a callback yet and the message\r
- * is thus never received by client?\r
- */\r
-\r
- /* Call init context callback */\r
- INVOKE_WCB( *window, InitContext, ());\r
-\r
- /* Lastly, check if we have a display callback, error out if not\r
- * This is the right place to do it, as the redisplay will be\r
- * next right after we exit this function, so there is no more\r
- * opportunity for the user to register a callback for this window.\r
- */\r
- if (!FETCH_WCB(*window, Display))\r
- fgError ( "ERROR: No display callback registered for window %d\n", window->ID );\r
- }\r
+}\r
\r
+void fgPlatformPosResZordWork(SFG_Window* window, unsigned int workMask)\r
+{\r
if (workMask & GLUT_FULL_SCREEN_WORK)\r
fgPlatformFullScreenToggle( window );\r
if (workMask & GLUT_POSITION_WORK)\r
else\r
fgPlatformPopWindow( window );\r
}\r
+}\r
\r
- if (workMask & GLUT_VISIBILITY_WORK)\r
+void fgPlatformVisibilityWork(SFG_Window* window)\r
+{\r
+ /* Visibility status of window should get updated in the window message handlers\r
+ * For now, none of these functions called below do anything, so don't worry\r
+ * about it\r
+ */\r
+ SFG_Window *win = window;\r
+ switch (window->State.DesiredVisibility)\r
{\r
- /* Visibility status of window should get updated in the window message handlers\r
- * For now, none of these functions called below do anything, so don't worry\r
- * about it\r
- */\r
- SFG_Window *win = window;\r
- switch (window->State.DesiredVisibility)\r
- {\r
- case DesireHiddenState:\r
- fgPlatformHideWindow( window );\r
- break;\r
- case DesireIconicState:\r
- /* Call on top-level window */\r
- while (win->Parent)\r
- win = win->Parent;\r
- fgPlatformIconifyWindow( win );\r
- break;\r
- case DesireNormalState:\r
- fgPlatformShowWindow( window );\r
- break;\r
- }\r
+ case DesireHiddenState:\r
+ fgPlatformHideWindow( window );\r
+ break;\r
+ case DesireIconicState:\r
+ /* Call on top-level window */\r
+ while (win->Parent)\r
+ win = win->Parent;\r
+ fgPlatformIconifyWindow( win );\r
+ break;\r
+ case DesireNormalState:\r
+ fgPlatformShowWindow( window );\r
+ break;\r
}\r
}\r
\r