return implementation.GetState(index);
}
+ internal static Guid GetGuid(int index)
+ {
+ return implementation.GetGuid(index);
+ }
+
//public string GetName(int index)
//{
// return implementation.GetName(index);
readonly MappedGamePadDriver gamepad_driver = new MappedGamePadDriver();
bool disposed;
- struct Sdl2JoystickDetails
+ class Sdl2JoystickDetails
{
public IntPtr Handle { get; set; }
+ public Guid Guid { get; set; }
public int HatCount { get; set; }
public int BallCount { get; set; }
public bool IsConnected { get; set; }
joystick = new JoystickDevice<Sdl2JoystickDetails>(id, num_axes, num_buttons);
joystick.Description = SDL.JoystickName(handle);
joystick.Details.Handle = handle;
+ joystick.Details.Guid = SDL.JoystickGetGUID(handle).ToGuid();
joystick.Details.HatCount = num_hats;
joystick.Details.BallCount = num_balls;
return new JoystickCapabilities();
}
+ Guid IJoystickDriver2.GetGuid(int index)
+ {
+ Guid guid = new Guid();
+ if (IsJoystickValid(index))
+ {
+ JoystickDevice<Sdl2JoystickDetails> joystick =
+ (JoystickDevice<Sdl2JoystickDetails>)joysticks[index];
+
+ return joystick.Details.Guid;
+ }
+ return guid;
+ }
+
#endregion
#region IDisposable Members