mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-16 16:16:04 -04:00
Feat[input]: send mouse position events before all other events
This commit is contained in:
parent
93cf884d8b
commit
b876d3c3a5
@ -104,6 +104,13 @@ void pojavPumpEvents(void* window) {
|
|||||||
// by spec, they will be called on the same thread so no synchronization here
|
// by spec, they will be called on the same thread so no synchronization here
|
||||||
pojav_environ->isPumpingEvents = true;
|
pojav_environ->isPumpingEvents = true;
|
||||||
|
|
||||||
|
if((pojav_environ->cLastX != pojav_environ->cursorX || pojav_environ->cLastY != pojav_environ->cursorY) && pojav_environ->GLFW_invoke_CursorPos) {
|
||||||
|
pojav_environ->cLastX = pojav_environ->cursorX;
|
||||||
|
pojav_environ->cLastY = pojav_environ->cursorY;
|
||||||
|
pojav_environ->GLFW_invoke_CursorPos(window, floor(pojav_environ->cursorX),
|
||||||
|
floor(pojav_environ->cursorY));
|
||||||
|
}
|
||||||
|
|
||||||
size_t index = pojav_environ->outEventIndex;
|
size_t index = pojav_environ->outEventIndex;
|
||||||
size_t targetIndex = pojav_environ->outTargetIndex;
|
size_t targetIndex = pojav_environ->outTargetIndex;
|
||||||
|
|
||||||
@ -139,12 +146,6 @@ void pojavPumpEvents(void* window) {
|
|||||||
if (index >= EVENT_WINDOW_SIZE)
|
if (index >= EVENT_WINDOW_SIZE)
|
||||||
index -= EVENT_WINDOW_SIZE;
|
index -= EVENT_WINDOW_SIZE;
|
||||||
}
|
}
|
||||||
if((pojav_environ->cLastX != pojav_environ->cursorX || pojav_environ->cLastY != pojav_environ->cursorY) && pojav_environ->GLFW_invoke_CursorPos) {
|
|
||||||
pojav_environ->cLastX = pojav_environ->cursorX;
|
|
||||||
pojav_environ->cLastY = pojav_environ->cursorY;
|
|
||||||
pojav_environ->GLFW_invoke_CursorPos(window, floor(pojav_environ->cursorX),
|
|
||||||
floor(pojav_environ->cursorY));
|
|
||||||
}
|
|
||||||
|
|
||||||
// The out target index is updated by the rewinder
|
// The out target index is updated by the rewinder
|
||||||
pojav_environ->isPumpingEvents = false;
|
pojav_environ->isPumpingEvents = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user