Chapter 5. Input

Getting input from the user is as important as rendering, but this subject does not often get as much attention because, frankly, it just doesn’t change very often. We’re going to use DirectInput to get input from the keyboard and the mouse in this chapter. DirectInput hasn’t changed in many years and is still at version 8.1. Contrast that with the huge changes taking place with Direct3D every year! Although we can use a joystick, it’s such a non-standard device for the PC that it’s not worth the effort. Granted, if you’re working on a game that would benefit from a joystick, by all means support it! Just note that most PC gamers prefer a keyboard and mouse. If you want to support an Xbox 360 controller, you can look into the XInput library, which is now packaged with the DirectX SDK (as well as included with XNA Game Studio).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset