T3D图形库DInput 头文件部分
- /*2008.10.1
- T3D图形库
- ——<<windows游戏
- 编程大师技巧>>
- */
- #ifndef DI_LIB
- #define DI_LIB
- // DI_LIB.H
- int DInput_Init(void);
- void DInput_Shutdown(void);
- int DInput_Init_Joystick(int min_x=-256, int max_x=256,
- int min_y=-256, int max_y=256, int dead_zone=10);
- int DInput_Init_Mouse(void);
- int DInput_Init_Keyboard(void);
- int DInput_Read_Joystick(void);
- int DInput_Read_Mouse(void);
- int DInput_Read_Keyboard(void);
- void DInput_Release_Joystick(void);
- void DInput_Release_Mouse(void);
- void DInput_Release_Keyboard(void);
- extern HWND main_window_handle; // save the window handle
- extern HINSTANCE main_instance; // save the instance
- // directinput全局变量
- extern LPDIRECTINPUT8 lpdi; // dinput object
- extern LPDIRECTINPUTDEVICE8 lpdikey; // dinput keyboard
- extern LPDIRECTINPUTDEVICE8 lpdimouse; // dinput mouse
- extern LPDIRECTINPUTDEVICE8 lpdijoy; // dinput joystick
- extern GUID joystickGUID; // guid for main joystick
- extern char joyname[80]; // name of joystick
- extern UCHAR keyboard_state[256]; // contains keyboard state table
- extern DIMOUSESTATE mouse_state; // contains state of mouse
- extern DIJOYSTATE joy_state; // contains state of joystick
- extern int joystick_found; // tracks if stick is plugged in
- #endif