Improvements from Alfred:

- Added new SDL_HINT_ALLOW_TOPMOST hint, when set to "0" then never set the topmost bit on a window. Useful when debugging fullscreen issues.
- fixed crash in windows joystick scanning if we failed to load the xinput dll
- added support for SDL_WINDOW_FULLSCREEN_DESKTOP under windows
- synthesize relative mouse movements if directinput fails to send relative moves, happens under virtual box.
This commit is contained in:
Sam Lantinga 2012-12-31 09:30:15 -08:00
parent 1b938d7de2
commit f4294fd806
5 changed files with 103 additions and 29 deletions

View file

@ -569,28 +569,30 @@ SDL_JoystickThread(void *_data)
}
}
// scan for any change in XInput devices
for ( userId = 0; userId < 4; userId++ )
if ( XINPUTGETCAPABILITIES )
{
XINPUT_CAPABILITIES capabilities;
DWORD result;
if ( bOpenedXInputDevices[userId] == SDL_TRUE )
nCurrentOpenedXInputDevices++;
result = XINPUTGETCAPABILITIES( userId, XINPUT_FLAG_GAMEPAD, &capabilities );
if ( result == ERROR_SUCCESS )
// scan for any change in XInput devices
for ( userId = 0; userId < 4; userId++ )
{
bOpenedXInputDevices[userId] = SDL_TRUE;
nNewOpenedXInputDevices++;
}
else
{
bOpenedXInputDevices[userId] = SDL_FALSE;
XINPUT_CAPABILITIES capabilities;
DWORD result;
if ( bOpenedXInputDevices[userId] == SDL_TRUE )
nCurrentOpenedXInputDevices++;
result = XINPUTGETCAPABILITIES( userId, XINPUT_FLAG_GAMEPAD, &capabilities );
if ( result == ERROR_SUCCESS )
{
bOpenedXInputDevices[userId] = SDL_TRUE;
nNewOpenedXInputDevices++;
}
else
{
bOpenedXInputDevices[userId] = SDL_FALSE;
}
}
}
if ( s_pKnownJoystickGUIDs && ( s_bWindowsDeviceChanged || nNewOpenedXInputDevices != nCurrentOpenedXInputDevices ) )
{
SDL_Delay( 300 ); // wait for direct input to find out about this device