Reset mouse state when changing video modes
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40461
This commit is contained in:
parent
d79f2837b1
commit
8b7ced1708
4 changed files with 49 additions and 34 deletions
|
@ -59,6 +59,17 @@ int SDL_MouseInit(void)
|
|||
return(0);
|
||||
}
|
||||
|
||||
/* We lost the mouse, so post button up messages for all pressed buttons */
|
||||
void SDL_ResetMouse(void)
|
||||
{
|
||||
int i;
|
||||
for ( i = 0; i < sizeof(SDL_ButtonState)*8; ++i ) {
|
||||
if ( SDL_ButtonState & SDL_BUTTON(i) ) {
|
||||
SDL_PrivateMouseButton(SDL_RELEASED, i, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Uint8 SDL_GetMouseState (int *x, int *y)
|
||||
{
|
||||
if ( x )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue