///////////////////////////////////////////////////////
| 334 | |
| 335 | //////////////////////////////////////////////////////////// |
| 336 | void onNativeWindowCreated(ANativeActivity* activity, ANativeWindow* window) |
| 337 | { |
| 338 | sf::priv::ActivityStates& states = retrieveStates(*activity); |
| 339 | const std::lock_guard lock(states.mutex); |
| 340 | |
| 341 | // Update the activity states |
| 342 | states.window = window; |
| 343 | |
| 344 | // If we have no context it's during window creation so don't send the focus event or it will try |
| 345 | // to recreate the surface again |
| 346 | if (states.context) |
| 347 | { |
| 348 | states.forwardEvent(sf::Event::FocusGained{}); |
| 349 | } |
| 350 | |
| 351 | // Wait for the event to be taken into account by SFML |
| 352 | states.updated = false; |
| 353 | while (!(states.updated | states.terminated)) |
| 354 | { |
| 355 | states.mutex.unlock(); |
| 356 | sf::sleep(sf::milliseconds(10)); |
| 357 | states.mutex.lock(); |
| 358 | } |
| 359 | } |
| 360 | |
| 361 | //////////////////////////////////////////////////////////// |
| 362 | void onNativeWindowDestroyed(ANativeActivity* activity, ANativeWindow* /* window */) |
nothing calls this directly
no test coverage detected