(svn r4075) - Feature: Undraw the mouse when it leaves the window and Draw it again when it enters. Added both for WIN32 and SDL. Since Win95 has troubles with TrackMouseEvent(), this function was just simply rewritten which was the easiest. Based on a patch by DmitryKo.

This commit is contained in:
Darkvater
2006-03-24 00:42:35 +00:00
parent 41f4c473da
commit fb48c3b4aa
5 changed files with 76 additions and 9 deletions

View File

@@ -345,6 +345,15 @@ static int PollEvent(void)
}
break;
case SDL_ACTIVEEVENT:
if (ev.active.gain == 1) // mouse entered the window, enable cursor
_cursor.in_window = true;
else if (ev.active.gain == 0) {
UndrawMouseCursor(); // mouse left the window, undraw cursor
_cursor.in_window = false;
}
break;
case SDL_QUIT:
// do not ask to quit on the main screen
if (_game_mode != GM_MENU) {