Process all pending events.
| 597 | |
| 598 | // Process all pending events. |
| 599 | static bool ProcessEventLoop(android_app *appState) { |
| 600 | int id; |
| 601 | int events; |
| 602 | android_poll_source *source; |
| 603 | |
| 604 | // If not animating, we will block forever waiting for events. |
| 605 | // If animating, we loop until all events are read, then continue |
| 606 | // to draw the next frame of animation. |
| 607 | while ((id = ALooper_pollAll(!suspended ? 0 : -1, nullptr, &events, (void **)&source)) >= 0) { |
| 608 | // Process this event. |
| 609 | if (source) { |
| 610 | source->process(appState, source); |
| 611 | } |
| 612 | |
| 613 | ProcessSensors(id); |
| 614 | |
| 615 | // Check if we are exiting. |
| 616 | if (appState->destroyRequested != 0) { |
| 617 | return false; |
| 618 | } |
| 619 | } |
| 620 | |
| 621 | return true; |
| 622 | } |
| 623 | |
| 624 | extern "C" { |
| 625 |
no test coverage detected