mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 14:21:04 +08:00
Remove use of deprecated ALooper_pollAll
This commit is contained in:
parent
dffdaa52a7
commit
6b4da70e15
@ -166,7 +166,8 @@ void setVirtualKeyboardVisible(bool visible)
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
bool isMouseButtonPressed(Mouse::Button button)
|
bool isMouseButtonPressed(Mouse::Button button)
|
||||||
{
|
{
|
||||||
ALooper_pollAll(0, nullptr, nullptr, nullptr);
|
while (ALooper_pollOnce(0, nullptr, nullptr, nullptr) >= 0)
|
||||||
|
;
|
||||||
|
|
||||||
ActivityStates& states = getActivity();
|
ActivityStates& states = getActivity();
|
||||||
const std::lock_guard lock(states.mutex);
|
const std::lock_guard lock(states.mutex);
|
||||||
@ -178,7 +179,8 @@ bool isMouseButtonPressed(Mouse::Button button)
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
Vector2i getMousePosition()
|
Vector2i getMousePosition()
|
||||||
{
|
{
|
||||||
ALooper_pollAll(0, nullptr, nullptr, nullptr);
|
while (ALooper_pollOnce(0, nullptr, nullptr, nullptr) >= 0)
|
||||||
|
;
|
||||||
|
|
||||||
ActivityStates& states = getActivity();
|
ActivityStates& states = getActivity();
|
||||||
const std::lock_guard lock(states.mutex);
|
const std::lock_guard lock(states.mutex);
|
||||||
@ -211,7 +213,8 @@ void setMousePosition(Vector2i position, const WindowBase& /* relativeTo */)
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
bool isTouchDown(unsigned int finger)
|
bool isTouchDown(unsigned int finger)
|
||||||
{
|
{
|
||||||
ALooper_pollAll(0, nullptr, nullptr, nullptr);
|
while (ALooper_pollOnce(0, nullptr, nullptr, nullptr) >= 0)
|
||||||
|
;
|
||||||
|
|
||||||
ActivityStates& states = getActivity();
|
ActivityStates& states = getActivity();
|
||||||
const std::lock_guard lock(states.mutex);
|
const std::lock_guard lock(states.mutex);
|
||||||
@ -223,7 +226,8 @@ bool isTouchDown(unsigned int finger)
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
Vector2i getTouchPosition(unsigned int finger)
|
Vector2i getTouchPosition(unsigned int finger)
|
||||||
{
|
{
|
||||||
ALooper_pollAll(0, nullptr, nullptr, nullptr);
|
while (ALooper_pollOnce(0, nullptr, nullptr, nullptr) >= 0)
|
||||||
|
;
|
||||||
|
|
||||||
ActivityStates& states = getActivity();
|
ActivityStates& states = getActivity();
|
||||||
const std::lock_guard lock(states.mutex);
|
const std::lock_guard lock(states.mutex);
|
||||||
|
@ -120,7 +120,8 @@ void SensorImpl::close()
|
|||||||
Vector3f SensorImpl::update() const
|
Vector3f SensorImpl::update() const
|
||||||
{
|
{
|
||||||
// Update our sensor data list
|
// Update our sensor data list
|
||||||
ALooper_pollAll(0, nullptr, nullptr, nullptr);
|
while (ALooper_pollOnce(0, nullptr, nullptr, nullptr) >= 0)
|
||||||
|
;
|
||||||
|
|
||||||
return sensorData[m_type];
|
return sensorData[m_type];
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,8 @@ WindowHandle WindowImplAndroid::getNativeHandle() const
|
|||||||
void WindowImplAndroid::processEvents()
|
void WindowImplAndroid::processEvents()
|
||||||
{
|
{
|
||||||
// Process incoming OS events
|
// Process incoming OS events
|
||||||
ALooper_pollAll(0, nullptr, nullptr, nullptr);
|
while (ALooper_pollOnce(0, nullptr, nullptr, nullptr) >= 0)
|
||||||
|
;
|
||||||
|
|
||||||
ActivityStates& states = getActivity();
|
ActivityStates& states = getActivity();
|
||||||
const std::lock_guard lock(states.mutex);
|
const std::lock_guard lock(states.mutex);
|
||||||
|
Loading…
Reference in New Issue
Block a user