DirectInput步骤

来源:互联网 发布:淘宝橱窗位怎么增加 编辑:程序博客网 时间:2024/04/28 23:28

1.创建DirectInput对象接口(可以控制设备的创建,更新,获取信息)-------------DirectInput8Create()

2.创建设备(例如:键盘,鼠标)------------IDirectInput8::CreateDevice()

3.设置设备数据形式(例如:获取键盘信息

   使用c_dfDIKeyboard结构体即一个256字符的数组)---------IDirectInputDevice::SetDataFormat()

4.设置协作级别(与其他应用程序间设备的共享与独占)------IDirectInputDevice::SetCooperativeLeve()

5.设备的获取(获得设备的使用权)------IDirectInput8Device::Acquire()

 

6.输入的获取  a,即时数据IDirectInputDevice8::GetDeviceState()

                    b,缓存数据IDirectInputDevice8::GetDeviceData()

 

 

 

原创粉丝点击