コード例 #1
0
ファイル: DirectXJoystick.cs プロジェクト: guerro323/GameHost
        public DirectXJoystick(InputManager creator, MDI.DirectInput device, bool buffered, MDI.CooperativeLevel coopSettings)
        {
            Creator            = creator;
            this._directInput  = device;
            IsBuffered         = buffered;
            this._coopSettings = coopSettings;
            Type          = InputType.Joystick;
            EventListener = null;

            this._joyInfo = (JoystickInfo)((DirectXInputManager)Creator).CaptureDevice <Joystick>();

            if (this._joyInfo == null)
            {
                throw new Exception("No devices match requested type.");
            }

            this._deviceGuid = this._joyInfo.DeviceId;
            Vendor           = this._joyInfo.Vendor;
            DeviceID         = this._joyInfo.Id.ToString();
        }
コード例 #2
0
ファイル: DirectXMouse.cs プロジェクト: guerro323/GameHost
        public DirectXMouse(InputManager creator, MDI.DirectInput device, bool buffered, MDI.CooperativeLevel coopSettings)
        {
            Creator            = creator;
            this._directInput  = device;
            IsBuffered         = buffered;
            this._coopSettings = coopSettings;
            Type          = InputType.Mouse;
            EventListener = null;

            this._msInfo = (MouseInfo)((DirectXInputManager)Creator).CaptureDevice <Mouse>();

            if (this._msInfo == null)
            {
                throw new Exception("No devices match requested type.");
            }

            this._hideMouse = ((DirectXInputManager)creator).HideMouse;

            Log.Debug("DirectXMouse device created.");
        }
コード例 #3
0
 public void SetCooperativeLevel(SharpDX.DirectInput.CooperativeLevel Level)
 {
     this.joystick.SetCooperativeLevel(MainForm.PublicHandle, Level);
 }