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

Function onContentRectChanged

src/SFML/Main/MainAndroid.cpp:431–445  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

429
430////////////////////////////////////////////////////////////
431void onContentRectChanged(ANativeActivity* activity, const ARect* /* rect */)
432{
433 // Retrieve our activity states from the activity instance
434 sf::priv::ActivityStates& states = retrieveStates(*activity);
435 const std::lock_guard lock(states.mutex);
436
437 // Make sure the window still exists before we access the dimensions on it
438 if (states.window != nullptr)
439 {
440 // Send an event to warn people about the window move/resize
441 const sf::Event::Resized event{
442 sf::Vector2u(sf::Vector2(ANativeWindow_getWidth(states.window), ANativeWindow_getHeight(states.window)))};
443 states.forwardEvent(event);
444 }
445}
446
447////////////////////////////////////////////////////////////
448void onConfigurationChanged(ANativeActivity* /* activity */)

Callers

nothing calls this directly

Calls 2

forwardEventMethod · 0.80
Vector2Class · 0.50

Tested by

no test coverage detected