bool IsAxisBind(IntPtr gamecontroller, GameControllerAxis axis) { GameControllerButtonBind bind = SDL.GameControllerGetBindForAxis(gamecontroller, axis); return(bind.BindType == GameControllerBindType.Axis); }
GamePadAxes TranslateAxis(GameControllerAxis axis) { switch (axis) { case GameControllerAxis.LeftX: return(GamePadAxes.LeftX); case GameControllerAxis.LeftY: return(GamePadAxes.LeftY); case GameControllerAxis.RightX: return(GamePadAxes.RightX); case GameControllerAxis.RightY: return(GamePadAxes.RightY); case GameControllerAxis.TriggerLeft: return(GamePadAxes.LeftTrigger); case GameControllerAxis.TriggerRight: return(GamePadAxes.RightTrigger); default: throw new ArgumentOutOfRangeException( String.Format("[SDL] Unknown axis {0}", axis)); } }
public static string GameControllerGetStringForAxis( GameControllerAxis axis ) { return(UTF8_ToManaged( INTERNAL_GameControllerGetStringForAxis( axis ) )); }
public GameControllerBind?GetBind(GameControllerAxis axis) { var ret = GameControllerBind.Create(SDL_GameControllerGetBindForAxis(j, axis)); if (ret == null) { var err = GetError(); if (err != null) { throw err; } } return(ret); }
public short this[GameControllerAxis index] { get { var v = SDL_GameControllerGetAxis(j, index); if (v == 0) { var err = GetError(); if (err != null) { throw err; } } return(v); } }
public static GameControllerButtonBind GameControllerGetBindForAxis( IntPtr gamecontroller, GameControllerAxis axis ) { // This is guaranteed to never be null INTERNAL_GameControllerButtonBind dumb = INTERNAL_GameControllerGetBindForAxis( gamecontroller, axis ); GameControllerButtonBind result = new GameControllerButtonBind(); result.BindType = (GameControllerBindType)dumb.BindType; result.Value.Hat.Hat = dumb.UnionVal0; result.Value.Hat.HatMask = dumb.UnionVal1; return(result); }
private static extern INTERNAL_GameControllerButtonBind INTERNAL_GameControllerGetBindForAxis( IntPtr gamecontroller, GameControllerAxis axis );
/// <summary> /// Maps an axis to a name. /// </summary> /// <param name="axis">The axis.</param> /// <returns>The name.</returns> public static string GetStringForAxis(GameControllerAxis axis) => Native.SDL_GameControllerGetStringForAxis(axis);
private static extern IntPtr INTERNAL_GameControllerGetStringForAxis( GameControllerAxis axis );
GamePadAxes TranslateAxis(GameControllerAxis axis) { switch (axis) { case GameControllerAxis.LeftX: return GamePadAxes.LeftX; case GameControllerAxis.LeftY: return GamePadAxes.LeftY; case GameControllerAxis.RightX: return GamePadAxes.RightX; case GameControllerAxis.RightY: return GamePadAxes.RightY; case GameControllerAxis.TriggerLeft: return GamePadAxes.LeftTrigger; case GameControllerAxis.TriggerRight: return GamePadAxes.RightTrigger; default: throw new ArgumentOutOfRangeException( String.Format("[SDL] Unknown axis {0}", axis)); } }
bool IsAxisBind(IntPtr gamecontroller, GameControllerAxis axis) { GameControllerButtonBind bind = SDL.GameControllerGetBindForAxis(gamecontroller, axis); return bind.BindType == GameControllerBindType.Axis; }
/// <summary> /// The axis value. /// </summary> /// <param name="axis">The axis.</param> /// <returns>The value.</returns> public short GetAxis(GameControllerAxis axis) => Native.SDL_GameControllerGetAxis(Pointer, axis);
public static extern short SDL_GameControllerGetAxis(GameController gamecontroller, GameControllerAxis axis);
public static extern /*const char*/ byte *SDL_GameControllerGetStringForAxis(GameControllerAxis axis);
public static unsafe string AxisName(GameControllerAxis b) => ErrorIfNull(UTF8ToString(SDL_GameControllerGetStringForAxis(b))) ?? "";
public static string GameControllerGetStringForAxisString(GameControllerAxis axis) { return(GetString(GameControllerGetStringForAxis(axis))); }
public static extern byte *GameControllerGetStringForAxis(GameControllerAxis axis);
public static extern GameControllerButtonBind GameControllerGetBindForAxis(GameController gameController, GameControllerAxis axis);
public static extern short GameControllerGetAxis(IntPtr gamecontroller, GameControllerAxis axis);
public static extern short GameControllerGetAxis( IntPtr gamecontroller, GameControllerAxis axis );
public static extern GameControllerButtonBind GameControllerGetBindForAxis(IntPtr gamecontroller, GameControllerAxis axis);
/// <summary> /// /// </summary> /// <param name="gameControllerAxis"></param> /// <returns></returns> public static SDL.SDL_GameControllerAxis ToSdl(this GameControllerAxis gameControllerAxis) { return((SDL.SDL_GameControllerAxis)gameControllerAxis); }
/// <summary> /// Gets the binding for the axis. /// </summary> /// <param name="axis">The axis.</param> /// <returns>The binding.</returns> public GameControllerBinding?GetAxisBinding(GameControllerAxis axis) => GameControllerBinding.FromNative(Native.SDL_GameControllerGetBindForAxis(Pointer, axis));