Platform SDK: DirectX |
The information in this topic pertains only to applications written in C++. See DirectInput Visual Basic Tutorials.
After retrieving an IDirectInputDevice7 pointer, your application must set the device's data format. For mouse devices, this is a very simple task. Call the IDirectInputDevice7::SetDataFormat method, specifying the data format provided for your convenience by DirectInput in the c_dfDIMouse global variable.
The following code attempts to set the device's data format. If the call fails, FALSE is returned.
hr = g_pMouse->SetDataFormat(&c_dfDIMouse); if (FAILED(hr)) { return FALSE; }