Mercurial > sdl-ios-xcode
comparison src/events/SDL_mouse.c @ 460:a888b3ae31ff
Reset mouse state when changing video modes
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 20 Aug 2002 06:01:20 +0000 |
parents | f6ffac90895c |
children | 300b46757b7a |
comparison
equal
deleted
inserted
replaced
459:2a778055dbba | 460:a888b3ae31ff |
---|---|
55 SDL_DeltaY = 0; | 55 SDL_DeltaY = 0; |
56 SDL_ButtonState = 0; | 56 SDL_ButtonState = 0; |
57 | 57 |
58 /* That's it! */ | 58 /* That's it! */ |
59 return(0); | 59 return(0); |
60 } | |
61 | |
62 /* We lost the mouse, so post button up messages for all pressed buttons */ | |
63 void SDL_ResetMouse(void) | |
64 { | |
65 int i; | |
66 for ( i = 0; i < sizeof(SDL_ButtonState)*8; ++i ) { | |
67 if ( SDL_ButtonState & SDL_BUTTON(i) ) { | |
68 SDL_PrivateMouseButton(SDL_RELEASED, i, 0, 0); | |
69 } | |
70 } | |
60 } | 71 } |
61 | 72 |
62 Uint8 SDL_GetMouseState (int *x, int *y) | 73 Uint8 SDL_GetMouseState (int *x, int *y) |
63 { | 74 { |
64 if ( x ) | 75 if ( x ) |