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

Function onNativeWindowDestroyed

src/SFML/Main/MainAndroid.cpp:362–381  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

360
361////////////////////////////////////////////////////////////
362void onNativeWindowDestroyed(ANativeActivity* activity, ANativeWindow* /* window */)
363{
364 sf::priv::ActivityStates& states = retrieveStates(*activity);
365 const std::lock_guard lock(states.mutex);
366
367 // Update the activity states
368 states.window = nullptr;
369
370 // Notify SFML mechanism
371 states.forwardEvent(sf::Event::FocusLost{});
372
373 // Wait for the event to be taken into account by SFML
374 states.updated = false;
375 while (!(states.updated | states.terminated))
376 {
377 states.mutex.unlock();
378 sf::sleep(sf::milliseconds(10));
379 states.mutex.lock();
380 }
381}
382
383////////////////////////////////////////////////////////////
384void onNativeWindowRedrawNeeded(ANativeActivity* /* activity */, ANativeWindow* /* window */)

Callers

nothing calls this directly

Calls 2

sleepFunction · 0.85
forwardEventMethod · 0.80

Tested by

no test coverage detected