static bool android_run_events (void *data) { int id = ALooper_pollOnce(-1, NULL, NULL, NULL); if (id == LOOPER_ID_MAIN) engine_handle_cmd(); // Check if we are exiting. if (g_extern.lifecycle_state & (1ULL << RARCH_QUIT_KEY)) return false; return true; }
static bool android_run_events (void *data) { int id = ALooper_pollOnce(-1, NULL, NULL, NULL); if (id == LOOPER_ID_MAIN) engine_handle_cmd(driver.input_data); // Check if we are exiting. if (g_extern.system.shutdown) return false; return true; }
static void gfx_ctx_check_window(bool *quit, bool *resize, unsigned *width, unsigned *height, unsigned frame_count) { (void)width; (void)height; (void)frame_count; int id; struct android_app* android_app = g_android.app; *quit = false; *resize = false; RARCH_PERFORMANCE_INIT(alooper_pollonce); RARCH_PERFORMANCE_START(alooper_pollonce); id = ALooper_pollOnce(0, NULL, 0, NULL); if(id == LOOPER_ID_MAIN) { int8_t cmd; if (read(android_app->msgread, &cmd, sizeof(cmd)) == sizeof(cmd)) { if(cmd == APP_CMD_SAVE_STATE) free_saved_state(android_app); } else cmd = -1; engine_handle_cmd(android_app, cmd); } RARCH_PERFORMANCE_STOP(alooper_pollonce); // Check if we are exiting. if (g_extern.lifecycle_state & (1ULL << RARCH_QUIT_KEY)) *quit = true; }
static void gfx_ctx_check_window(bool *quit, bool *resize, unsigned *width, unsigned *height, unsigned frame_count) { (void)frame_count; struct android_app *android_app = (struct android_app*)g_android; *quit = false; unsigned new_width, new_height; gfx_ctx_get_video_size(&new_width, &new_height); if (new_width != *width || new_height != *height) { *width = new_width; *height = new_height; *resize = true; } RARCH_PERFORMANCE_INIT(alooper_pollonce); RARCH_PERFORMANCE_START(alooper_pollonce); while (ALooper_pollOnce(0, NULL, NULL, NULL) == LOOPER_ID_MAIN) { int8_t cmd; if (read(android_app->msgread, &cmd, sizeof(cmd)) != sizeof(cmd)) cmd = -1; engine_handle_cmd(android_app, cmd); } RARCH_PERFORMANCE_STOP(alooper_pollonce); // Check if we are exiting. if (g_extern.lifecycle_state & (1ULL << RARCH_QUIT_KEY)) *quit = true; }