Fix mouse events processing (#55)

This commit is contained in:
Alexander Batalov 2023-02-27 10:42:55 +03:00
parent dd9ca29939
commit fcb872cff7

View File

@ -76,6 +76,14 @@ bool dxinput_unacquire_mouse()
// 0x4E053C
bool dxinput_get_mouse_state(MouseData* mouseState)
{
// CE: This function is sometimes called outside loops calling `get_input`
// and subsequently `GNW95_process_message`, so mouse events might not be
// handled by SDL yet.
//
// TODO: Move mouse events processing into `GNW95_process_message` and
// update mouse position manually.
SDL_PumpEvents();
if (gLastInputType == INPUT_TYPE_TOUCH) {
mouseState->x = gTouchMouseDeltaX;
mouseState->y = gTouchMouseDeltaY;