XInput SetVibration
This commit is contained in:
parent
b4881a2c70
commit
31b9e4ce34
@ -44,6 +44,10 @@ EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsGame", "Samples\WindowsGame\WindowsGame.csproj", "{A08575E0-7B21-4822-9D4C-6B9EEB7EFFF7}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SubversionScc) = preSolution
|
||||
Svn-Managed = True
|
||||
Manager = AnkhSVN - Subversion Support for Visual Studio
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
|
@ -118,7 +118,16 @@ namespace ANX.InputSystem.Windows.XInput
|
||||
|
||||
public bool SetVibration(PlayerIndex playerIndex, float leftMotor, float rightMotor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
if (controller[(int)playerIndex].IsConnected)
|
||||
{
|
||||
Vibration vib = new Vibration();
|
||||
vib.LeftMotorSpeed = Convert.ToInt16(leftMotor * short.MaxValue);
|
||||
vib.RightMotorSpeed = Convert.ToInt16(rightMotor * short.MaxValue);
|
||||
controller[(int)playerIndex].SetVibration(vib);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user