Пример #1
0
        /// <summary>Get the current state of a button on a game controller.</summary>
/// <remarks>The button indices start at index 0.</remarks>
        public static byte GameControllerGetButton(global::SharpSDL.SDL_GameController gamecontroller, global::SharpSDL.GameControllerButton button)
        {
            var __arg0 = ReferenceEquals(gamecontroller, null) ? global::System.IntPtr.Zero : gamecontroller.__Instance;
            var __ret  = __Internal.GameControllerGetButton(__arg0, button);

            return(__ret);
        }
Пример #2
0
        /// <summary>
/// <para>Trigger a rumble effect</para>
/// <para>Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.</para>
/// </summary>
/// <param name="gamecontroller">The controller to vibrate</param>
/// <param name="low_frequency_rumble">The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF</param>
/// <param name="high_frequency_rumble">The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF</param>
/// <param name="duration_ms">The duration of the rumble effect, in milliseconds</param>
/// <returns>0, or -1 if rumble isn't supported on this joystick</returns>
        public static int GameControllerRumble(global::SharpSDL.SDL_GameController gamecontroller, ushort low_frequency_rumble, ushort high_frequency_rumble, uint duration_ms)
        {
            var __arg0 = ReferenceEquals(gamecontroller, null) ? global::System.IntPtr.Zero : gamecontroller.__Instance;
            var __ret  = __Internal.GameControllerRumble(__arg0, low_frequency_rumble, high_frequency_rumble, duration_ms);

            return(__ret);
        }
Пример #3
0
        /// <summary>
/// <para>Get the product version of an opened controller, if available.</para>
/// <para>If the product version isn't available this function returns 0.</para>
/// </summary>
        public static ushort GameControllerGetProductVersion(global::SharpSDL.SDL_GameController gamecontroller)
        {
            var __arg0 = ReferenceEquals(gamecontroller, null) ? global::System.IntPtr.Zero : gamecontroller.__Instance;
            var __ret  = __Internal.GameControllerGetProductVersion(__arg0);

            return(__ret);
        }
Пример #4
0
        /// <summary>Get the current state of an axis control on a game controller.</summary>
/// <remarks>
/// <para>The state is a value ranging from -32768 to 32767 (except for the triggers,</para>
/// <para>which range from 0 to 32767).</para>
/// <para>The axis indices start at index 0.</para>
/// </remarks>
        public static short GameControllerGetAxis(global::SharpSDL.SDL_GameController gamecontroller, global::SharpSDL.GameControllerAxis axis)
        {
            var __arg0 = ReferenceEquals(gamecontroller, null) ? global::System.IntPtr.Zero : gamecontroller.__Instance;
            var __ret  = __Internal.GameControllerGetAxis(__arg0, axis);

            return(__ret);
        }
Пример #5
0
        /// <summary>Get the player index of an opened game controller, or -1 if it's not available</summary>
/// <remarks>For XInput controllers this returns the XInput user index.</remarks>
        public static int GameControllerGetPlayerIndex(global::SharpSDL.SDL_GameController gamecontroller)
        {
            var __arg0 = ReferenceEquals(gamecontroller, null) ? global::System.IntPtr.Zero : gamecontroller.__Instance;
            var __ret  = __Internal.GameControllerGetPlayerIndex(__arg0);

            return(__ret);
        }
Пример #6
0
        /// <summary>Return the name for this currently opened controller</summary>
        public static string GameControllerName(global::SharpSDL.SDL_GameController gamecontroller)
        {
            var __arg0 = ReferenceEquals(gamecontroller, null) ? global::System.IntPtr.Zero : gamecontroller.__Instance;
            var __ret  = __Internal.GameControllerName(__arg0);

            return(Marshal.PtrToStringAnsi(__ret));
        }
Пример #7
0
        /// <summary>Get a mapping string for an open GameController</summary>
/// <returns>the mapping string.  Must be freed with SDL_free().  Returns NULL if no mapping is available</returns>
        public static sbyte *GameControllerMapping(global::SharpSDL.SDL_GameController gamecontroller)
        {
            var __arg0 = ReferenceEquals(gamecontroller, null) ? global::System.IntPtr.Zero : gamecontroller.__Instance;
            var __ret  = __Internal.GameControllerMapping(__arg0);

            return(__ret);
        }
Пример #8
0
        /// <summary>Get the underlying joystick object used by a controller</summary>
        public static global::SharpSDL.SDL_Joystick GameControllerGetJoystick(global::SharpSDL.SDL_GameController gamecontroller)
        {
            var __arg0 = ReferenceEquals(gamecontroller, null) ? global::System.IntPtr.Zero : gamecontroller.__Instance;
            var __ret  = __Internal.GameControllerGetJoystick(__arg0);

            global::SharpSDL.SDL_Joystick __result0;
            if (__ret == IntPtr.Zero)
            {
                __result0 = null;
            }
            else if (global::SharpSDL.SDL_Joystick.NativeToManagedMap.ContainsKey(__ret))
            {
                __result0 = (global::SharpSDL.SDL_Joystick)global::SharpSDL.SDL_Joystick.NativeToManagedMap[__ret];
            }
            else
            {
                __result0 = global::SharpSDL.SDL_Joystick.__CreateInstance(__ret);
            }
            return(__result0);
        }
Пример #9
0
        /// <summary>Close a controller previously opened with SDL_GameControllerOpen().</summary>
        public static void GameControllerClose(global::SharpSDL.SDL_GameController gamecontroller)
        {
            var __arg0 = ReferenceEquals(gamecontroller, null) ? global::System.IntPtr.Zero : gamecontroller.__Instance;

            __Internal.GameControllerClose(__arg0);
        }
Пример #10
0
        /// <summary>Get the SDL joystick layer binding for this controller button mapping</summary>
        public static global::SharpSDL.GameControllerButtonBind GameControllerGetBindForAxis(global::SharpSDL.SDL_GameController gamecontroller, global::SharpSDL.GameControllerAxis axis)
        {
            var __arg0 = ReferenceEquals(gamecontroller, null) ? global::System.IntPtr.Zero : gamecontroller.__Instance;
            var __ret  = __Internal.GameControllerGetBindForAxis(__arg0, axis);

            return(global::SharpSDL.GameControllerButtonBind.__CreateInstance(__ret));
        }