(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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user