mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 09:05:31 +00:00
[Input] Added SetVibration() API skeleton
This commit is contained in:
parent
ec43b9ff85
commit
8649e4a044
|
@ -65,5 +65,22 @@ namespace OpenTK.Input
|
|||
{
|
||||
return driver.GetState(index);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the vibration intensity for the left and right motors of this <see cref="GamePad"/>
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// <c>true</c>, if vibration was set, <c>false</c> otherwise. This method can return false
|
||||
/// if the <c>GamePad</c> hardware does not support vibration or if it cannot respond to
|
||||
/// the command for any reason. Do not loop until this becomes true, but rather ignore
|
||||
/// a return value of false.
|
||||
/// </returns>
|
||||
/// <param name="index">A zero-based device index for the <c>GamePad</c> device to affect</param>
|
||||
/// <param name="left">The vibration intensity for the left motor, between 0.0 and 1.0.</param>
|
||||
/// <param name="right">The vibration intensity for the right motor, between 0.0 and 1.0.</param>
|
||||
public static bool SetVibration(int index, float left, float right)
|
||||
{
|
||||
return driver.SetVibration(index, left, right);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,5 +19,7 @@ namespace OpenTK.Input
|
|||
/// <remarks>
|
||||
/// <para>If no device exists at the specified index, the return value is <see cref="System.String.Empty"/>.</para></remarks>
|
||||
string GetName(int index);
|
||||
|
||||
bool SetVibration(int index, float left, float right);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -168,6 +168,11 @@ namespace OpenTK.Platform
|
|||
return name;
|
||||
}
|
||||
|
||||
public bool SetVibration(int index, float left, float right)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#region Private Members
|
||||
|
||||
GamePadConfiguration GetConfiguration(Guid guid)
|
||||
|
|
|
@ -567,6 +567,11 @@ namespace OpenTK.Platform.SDL2
|
|||
{
|
||||
return gamepad_driver.GetName(index);
|
||||
}
|
||||
|
||||
public bool SetVibration(int index, float left, float right)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -87,7 +87,12 @@ namespace OpenTK.Platform.Windows
|
|||
|
||||
public string GetName(int index)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public bool SetVibration(int index, float left, float right)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -263,17 +263,22 @@ namespace OpenTK.Platform.X11
|
|||
|
||||
public GamePadCapabilities GetCapabilities(int index)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return new GamePadCapabilities();
|
||||
}
|
||||
|
||||
public GamePadState GetState(int index)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return new GamePadState();
|
||||
}
|
||||
|
||||
public string GetName(int index)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public bool SetVibration(int index, float left, float right)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -282,17 +287,17 @@ namespace OpenTK.Platform.X11
|
|||
|
||||
JoystickState IJoystickDriver2.GetState(int index)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return new JoystickState();
|
||||
}
|
||||
|
||||
JoystickCapabilities IJoystickDriver2.GetCapabilities(int index)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return new JoystickCapabilities();
|
||||
}
|
||||
|
||||
Guid IJoystickDriver2.GetGuid(int index)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return new Guid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
Loading…
Reference in a new issue