Remove use of deprecated ALooper_pollAll

This commit is contained in:
Chris Thrasher 2024-08-05 15:15:31 -06:00
parent 2a4ca6e053
commit a71b3a497b
3 changed files with 12 additions and 6 deletions

View File

@ -159,7 +159,8 @@ void InputImpl::setVirtualKeyboardVisible(bool visible)
////////////////////////////////////////////////////////////
bool InputImpl::isMouseButtonPressed(Mouse::Button button)
{
ALooper_pollAll(0, NULL, NULL, NULL);
while (ALooper_pollOnce(0, NULL, NULL, NULL) >= 0)
;
priv::ActivityStates& states = priv::getActivity();
Lock lock(states.mutex);
@ -171,7 +172,8 @@ bool InputImpl::isMouseButtonPressed(Mouse::Button button)
////////////////////////////////////////////////////////////
Vector2i InputImpl::getMousePosition()
{
ALooper_pollAll(0, NULL, NULL, NULL);
while (ALooper_pollOnce(0, NULL, NULL, NULL) >= 0)
;
priv::ActivityStates& states = priv::getActivity();
Lock lock(states.mutex);
@ -204,7 +206,8 @@ void InputImpl::setMousePosition(const Vector2i& position, const WindowBase& /*
////////////////////////////////////////////////////////////
bool InputImpl::isTouchDown(unsigned int finger)
{
ALooper_pollAll(0, NULL, NULL, NULL);
while (ALooper_pollOnce(0, NULL, NULL, NULL) >= 0)
;
priv::ActivityStates& states = priv::getActivity();
Lock lock(states.mutex);
@ -216,7 +219,8 @@ bool InputImpl::isTouchDown(unsigned int finger)
////////////////////////////////////////////////////////////
Vector2i InputImpl::getTouchPosition(unsigned int finger)
{
ALooper_pollAll(0, NULL, NULL, NULL);
while (ALooper_pollOnce(0, NULL, NULL, NULL) >= 0)
;
priv::ActivityStates& states = priv::getActivity();
Lock lock(states.mutex);

View File

@ -123,7 +123,8 @@ void SensorImpl::close()
Vector3f SensorImpl::update()
{
// Update our sensor data list
ALooper_pollAll(0, NULL, NULL, NULL);
while (ALooper_pollOnce(0, NULL, NULL, NULL) >= 0)
;
return sensorData[m_index];
}

View File

@ -102,7 +102,8 @@ WindowHandle WindowImplAndroid::getSystemHandle() const
void WindowImplAndroid::processEvents()
{
// Process incoming OS events
ALooper_pollAll(0, NULL, NULL, NULL);
while (ALooper_pollOnce(0, NULL, NULL, NULL) >= 0)
;
ActivityStates& states = getActivity();
Lock lock(states.mutex);