| 76 | } |
| 77 | |
| 78 | static int WaitForWindow() |
| 79 | { |
| 80 | while (glfwAndroidWindowOpened() == 0) |
| 81 | { |
| 82 | void* data = NULL; |
| 83 | int ident = ALooper_pollOnce(300, NULL, NULL, &data); |
| 84 | |
| 85 | struct android_app* app = dmAndroid::GetAndroidApp(); |
| 86 | assert(app); |
| 87 | |
| 88 | if (ident >= 0 && data != NULL) { |
| 89 | struct android_poll_source* source = (struct android_poll_source*)data; |
| 90 | source->process(app, source); |
| 91 | } |
| 92 | if (ident == ALOOPER_POLL_ERROR) { |
| 93 | dmLogFatal("ALooper_pollOnce returned an error"); |
| 94 | return 0; |
| 95 | } |
| 96 | |
| 97 | glfwAndroidFlushEvents(); |
| 98 | if (app->destroyRequested) { |
| 99 | return 0; |
| 100 | } |
| 101 | dmTime::Sleep(300); |
| 102 | } |
| 103 | return 1; |
| 104 | } |
| 105 | |
| 106 | int engine_main(int argc, char *argv[]) |
| 107 | { |
no test coverage detected