MCPcopy Create free account
hub / github.com/SFML/SFML / initializeMain

Function initializeMain

src/SFML/Main/MainAndroid.cpp:59–79  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

57{
58////////////////////////////////////////////////////////////
59void 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////////////////////////////////////////////////////////////
82void terminateMain(sf::priv::ActivityStates& states)

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected