Example #1
0
        public override void Stop()
        {
            SF = null;
            // Don't leave any keys pressed
            for (int i = 1; i < MyKeyDown.Length; i++)
            {
                if (MyKeyDown[i])
                {
                    KeyOrButtonUp(i);
                }
            }

            if (KeyboardDevice != null)
            {
                KeyboardDevice.Unacquire();
                KeyboardDevice.Dispose();
                KeyboardDevice = null;
            }

            if (mouseDevice != null)
            {
                mouseDevice.Unacquire();
                mouseDevice.Dispose();
                mouseDevice = null;
            }

            if (DirectInputInstance != null)
            {
                DirectInputInstance.Dispose();
                DirectInputInstance = null;
            }
        }
 public void Dispose()
 {
     if (keyboard != null)
     {
         keyboard.Unacquire();
         keyboard.Dispose();
         keyboard = null;
     }
 }
Example #3
0
        public void Dispose()
        {
            // scene stuff
            StarSystem.ActiveSystem.Dispose();
            skybox.Dispose();
            ControlPanel.Dispose();

            Shaders.Dispose();
            Resources.Dispose();

            // other stuff
            keyboard.Dispose();
            mouse.Dispose();

            renderer.Dispose();
            renderForm.Dispose();
        }