Exemple #1
0
        /// <summary>Get the current state of a button on a joystick.</summary>
/// <remarks>The button indices start at index 0.</remarks>
        public static byte JoystickGetButton(global::SharpSDL.SDL_Joystick joystick, int button)
        {
            var __arg0 = ReferenceEquals(joystick, null) ? global::System.IntPtr.Zero : joystick.__Instance;
            var __ret  = __Internal.JoystickGetButton(__arg0, button);

            return(__ret);
        }
Exemple #2
0
        /// <summary>Return the battery level of this joystick</summary>
        public static global::SharpSDL.JoystickPowerLevel JoystickCurrentPowerLevel(global::SharpSDL.SDL_Joystick joystick)
        {
            var __arg0 = ReferenceEquals(joystick, null) ? global::System.IntPtr.Zero : joystick.__Instance;
            var __ret  = __Internal.JoystickCurrentPowerLevel(__arg0);

            return(__ret);
        }
Exemple #3
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="joystick">The joystick 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 JoystickRumble(global::SharpSDL.SDL_Joystick joystick, ushort low_frequency_rumble, ushort high_frequency_rumble, uint duration_ms)
        {
            var __arg0 = ReferenceEquals(joystick, null) ? global::System.IntPtr.Zero : joystick.__Instance;
            var __ret  = __Internal.JoystickRumble(__arg0, low_frequency_rumble, high_frequency_rumble, duration_ms);

            return(__ret);
        }
Exemple #4
0
        /// <summary>Get the current state of an axis control on a joystick.</summary>
/// <remarks>
/// <para>The state is a value ranging from -32768 to 32767.</para>
/// <para>The axis indices start at index 0.</para>
/// </remarks>
        public static short JoystickGetAxis(global::SharpSDL.SDL_Joystick joystick, int axis)
        {
            var __arg0 = ReferenceEquals(joystick, null) ? global::System.IntPtr.Zero : joystick.__Instance;
            var __ret  = __Internal.JoystickGetAxis(__arg0, axis);

            return(__ret);
        }
Exemple #5
0
        /// <summary>Get the number of buttons on a joystick.</summary>
        public static int JoystickNumButtons(global::SharpSDL.SDL_Joystick joystick)
        {
            var __arg0 = ReferenceEquals(joystick, null) ? global::System.IntPtr.Zero : joystick.__Instance;
            var __ret  = __Internal.JoystickNumButtons(__arg0);

            return(__ret);
        }
Exemple #6
0
        /// <summary>Get the type of an opened joystick.</summary>
        public static global::SharpSDL.JoystickType JoystickGetType(global::SharpSDL.SDL_Joystick joystick)
        {
            var __arg0 = ReferenceEquals(joystick, null) ? global::System.IntPtr.Zero : joystick.__Instance;
            var __ret  = __Internal.JoystickGetType(__arg0);

            return(__ret);
        }
Exemple #7
0
        /// <summary>
/// <para>Get the product version of an opened joystick, if available.</para>
/// <para>If the product version isn't available this function returns 0.</para>
/// </summary>
        public static ushort JoystickGetProductVersion(global::SharpSDL.SDL_Joystick joystick)
        {
            var __arg0 = ReferenceEquals(joystick, null) ? global::System.IntPtr.Zero : joystick.__Instance;
            var __ret  = __Internal.JoystickGetProductVersion(__arg0);

            return(__ret);
        }
Exemple #8
0
        /// <summary>Return the GUID for this opened joystick</summary>
        public static global::SharpSDL.JoystickGUID JoystickGetGUID(global::SharpSDL.SDL_Joystick joystick)
        {
            var __arg0 = ReferenceEquals(joystick, null) ? global::System.IntPtr.Zero : joystick.__Instance;
            var __ret  = __Internal.JoystickGetGUID(__arg0);

            return(global::SharpSDL.JoystickGUID.__CreateInstance(__ret));
        }
Exemple #9
0
        /// <summary>
/// <para>Return the name for this currently opened joystick.</para>
/// <para>If no name can be found, this function returns NULL.</para>
/// </summary>
        public static string JoystickName(global::SharpSDL.SDL_Joystick joystick)
        {
            var __arg0 = ReferenceEquals(joystick, null) ? global::System.IntPtr.Zero : joystick.__Instance;
            var __ret  = __Internal.JoystickName(__arg0);

            return(Marshal.PtrToStringAnsi(__ret));
        }
Exemple #10
0
        /// <summary>Get the ball axis change since the last poll.</summary>
/// <returns>
/// <para>0, or -1 if you passed it invalid parameters.</para>
/// <para>The ball indices start at index 0.</para>
/// </returns>
        public static int JoystickGetBall(global::SharpSDL.SDL_Joystick joystick, int ball, ref int dx, ref int dy)
        {
            var __arg0 = ReferenceEquals(joystick, null) ? global::System.IntPtr.Zero : joystick.__Instance;

            fixed(int *__dx2 = &dx)
            {
                var __arg2 = __dx2;

                fixed(int *__dy3 = &dy)
                {
                    var __arg3 = __dy3;
                    var __ret  = __Internal.JoystickGetBall(__arg0, ball, __arg2, __arg3);

                    return(__ret);
                }
            }
        }
Exemple #11
0
        /// <summary>Close a joystick previously opened with SDL_JoystickOpen().</summary>
        public static void JoystickClose(global::SharpSDL.SDL_Joystick joystick)
        {
            var __arg0 = ReferenceEquals(joystick, null) ? global::System.IntPtr.Zero : joystick.__Instance;

            __Internal.JoystickClose(__arg0);
        }