Taking input into inputbox with direct input

Started by
11 comments, last by stupid_programmer 16 years, 1 month ago
If MS thinks DirectInput is such a bad idea why did they even develop it? Is it a holdover from older versions of DX where DI got input faster then in the WM_CHAR message?
Advertisement
Quote:Original post by stupid_programmer
If MS thinks DirectInput is such a bad idea why did they even develop it? Is it a holdover from older versions of DX where DI got input faster then in the WM_CHAR message?


Before Windows XP, there was no RawInput API in Win32 that gave you low-level access to input hardware. But now we do have them, and because of that all DirectInput does (in Windows >= XP) is hook your message procedure and use a separate thread to process WM_INPUT messages. This is an awful lot of overhead for something you could do yourself with less code.

DI was also more relevent when joysticks and gamepads were the primary input methods for games. These days if you worry about a gamepad at all, it's usually just the 360 gamepad.

[Edited by - MJP on March 10, 2008 10:19:20 PM]
Quote:Original post by MJP
Quote:Original post by stupid_programmer
If MS thinks DirectInput is such a bad idea why did they even develop it? Is it a holdover from older versions of DX where DI got input faster then in the WM_CHAR message?


Before Windows XP, there was no RawInput API in Win32 that gave you low-level access to input hardware. But now we do have them, and because of that all DirectInput does (in Windows >= XP) is hook your message procedure and use a separate thread to process WM_INPUT messages. This is an awful lot of overheard for something you could do yourself with less code.

DI was also more relevent when joysticks and gamepads were the primary input methods for games. These days if you worry about a gamepad at all, it's usually just the 360 gamepad.


Thanks, I guess it isn't that big of a deal to pass on an array of keyboard input into my actual input handler.

This topic is closed to new replies.

Advertisement