Input: Return const -20 mouse position when outside window

This commit is contained in:
Jonas Kulla 2014-01-05 01:15:33 +01:00
parent 318162a229
commit 8ed6de22a4
3 changed files with 12 additions and 1 deletions

View file

@ -42,7 +42,7 @@ EventThread::JoyState EventThread::joyState =
EventThread::MouseState EventThread::mouseState =
{
0, 0, { false }
0, 0, false, { false }
};
/* User event codes */
@ -129,12 +129,14 @@ void EventThread::process(RGSSThreadData &rtData)
case SDL_WINDOWEVENT_ENTER :
cursorInWindow = true;
mouseState.inWindow = true;
updateCursorState(cursorInWindow && windowFocused);
break;
case SDL_WINDOWEVENT_LEAVE :
cursorInWindow = false;
mouseState.inWindow = false;
updateCursorState(cursorInWindow && windowFocused);
break;