|Microsoft DirectX 9.0|
This tutorial guides you through the process of setting up a mouse device and retrieving buffered input data. The examples are based on the Scrawl Sample.
To prepare for mouse input, you first create an instance of a Microsoft?DirectInput?object. Then you use the IDirectInput8::CreateDevice method to create an instance of an IDirectInputDevice8 interface. The IDirectInputDevice8 interface methods are used to manipulate the device, set its behavior, and retrieve data.
The first step of setting up the DirectInput system and the final step of closing it down are the same for any application and are covered in Tutorial 1: Using the Keyboard.
This tutorial divides the required tasks into the following steps.