| 343 | } |
| 344 | |
| 345 | ExitCode AndroidPlatform::initialize(const std::vector<Plugin *> &plugins) |
| 346 | { |
| 347 | for (auto plugin : plugins) |
| 348 | { |
| 349 | plugin->clear_platform(); |
| 350 | } |
| 351 | android_app_set_key_event_filter(app, key_event_filter); |
| 352 | android_app_set_motion_event_filter(app, motion_event_filter); |
| 353 | |
| 354 | app->onAppCmd = on_app_cmd; |
| 355 | app->activity->callbacks->onContentRectChanged = on_content_rect_changed; |
| 356 | app->userData = this; |
| 357 | |
| 358 | auto code = Platform::initialize(plugins); |
| 359 | if (code != ExitCode::Success) |
| 360 | { |
| 361 | return code; |
| 362 | } |
| 363 | |
| 364 | // Wait until the android window is loaded before allowing the app to continue |
| 365 | LOGI("Waiting on window surface to be ready"); |
| 366 | do |
| 367 | { |
| 368 | if (!process_android_events(app)) |
| 369 | { |
| 370 | // Android requested for the app to close |
| 371 | LOGI("Android app has been destroyed by the OS"); |
| 372 | return ExitCode::Close; |
| 373 | } |
| 374 | } while (!surface_ready); |
| 375 | |
| 376 | return ExitCode::Success; |
| 377 | } |
| 378 | |
| 379 | void AndroidPlatform::create_window(const Window::Properties &properties) |
| 380 | { |
nothing calls this directly
no test coverage detected