///////////////////////////////////////////////////////
| 57 | { |
| 58 | //////////////////////////////////////////////////////////// |
| 59 | void initializeMain(sf::priv::ActivityStates& states) |
| 60 | { |
| 61 | // Protect from concurrent access |
| 62 | const std::lock_guard lock(states.mutex); |
| 63 | |
| 64 | // Prepare and share the looper to be read later |
| 65 | ALooper* looper = ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS); |
| 66 | states.looper = looper; |
| 67 | |
| 68 | /** |
| 69 | * Acquire increments a reference counter on the looper. This keeps android |
| 70 | * from collecting it before the activity thread has a chance to detach its |
| 71 | * input queue. |
| 72 | */ |
| 73 | ALooper_acquire(states.looper); |
| 74 | ALooper_wake(states.looper); |
| 75 | |
| 76 | // Get the default configuration |
| 77 | states.config = AConfiguration_new(); |
| 78 | AConfiguration_fromAssetManager(states.config, states.activity->assetManager); |
| 79 | } |
| 80 | |
| 81 | //////////////////////////////////////////////////////////// |
| 82 | void terminateMain(sf::priv::ActivityStates& states) |