void ANativeActivity_onCreate(ANativeActivity* activity, void* savedState, size_t savedStateSize) { activity->callbacks->onDestroy = onDestroy; activity->callbacks->onStart = onStart; activity->callbacks->onResume = onResume; activity->callbacks->onSaveInstanceState = onSaveInstanceState; activity->callbacks->onPause = onPause; activity->callbacks->onStop = onStop; activity->callbacks->onConfigurationChanged = onConfigurationChanged; activity->callbacks->onLowMemory = onLowMemory; activity->callbacks->onWindowFocusChanged = onWindowFocusChanged; activity->callbacks->onNativeWindowCreated = onNativeWindowCreated; activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed; activity->callbacks->onInputQueueCreated = onInputQueueCreated; activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyed; activity->instance = android_app_create(activity, savedState, savedStateSize); }
void ANativeActivity_onCreate( ANativeActivity* activity, void* savedState, size_t savedStateSize) { activity->callbacks->onDestroy = onDestroy; activity->callbacks->onStart = onStart; activity->callbacks->onResume = onResume; activity->callbacks->onSaveInstanceState = onSaveInstanceState; activity->callbacks->onPause = onPause; activity->callbacks->onStop = onStop; activity->callbacks->onConfigurationChanged = onConfigurationChanged; activity->callbacks->onLowMemory = onLowMemory; activity->callbacks->onWindowFocusChanged = onWindowFocusChanged; activity->callbacks->onNativeWindowCreated = onNativeWindowCreated; activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed; activity->callbacks->onInputQueueCreated = onInputQueueCreated; activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyed; activity->callbacks->onContentRectChanged = onContentRectChanged; // Create threaded android_app android_app* app = android_app_create(activity, savedState, savedStateSize); activity->instance = app; // Save global variables for use later memset(&g_engine, 0, sizeof(pangolin::engine)); app->userData = &g_engine; app->onAppCmd = pangolin::engine_handle_cmd; app->onInputEvent = pangolin::engine_handle_input; g_engine.app = app; g_engine.activity = activity; // // Load existing state if it exists // if (app->savedState != NULL) { // // We are starting with a previous saved state; restore from it. // g_engine.state = *(struct pangolin::saved_state*)app->savedState; // } }