Skip to main content
GameDev.net gamedev.net
🔒 Locked

DX Input question

Started by BillOB1 Dec 28, 2004 at 4:14 PM 2 replies 400+ views
Original Post
BillOB1
BillOB1
Hello, I am writing a game which requires high accuracy of response time from the input.How accurate(in time) is DX input compared to that of the windows' default message processing system?Is there really a big difference.DXInput looks so hard to use...
Aldenar
Aldenar
Hi,

Well, DirectInput was pretty much designed for games so you don't really have to worry about performance and accuracy. If you take the time to look into it, you'll see that it is not so hard (Check the Articles -> Programming -> DirectX -> DirectInput section of this site for examples, that and the samples from the DX SDK).

I'd say a big advantage of DirectInput is that it gives you a common interface for all kind of devices, I've never tried using a gamepad with basic Win32 functions (I don't even know if it is possible :) ), but with DI it is pretty easy. Also, you can poll the device whenever you want and DirectInput allows 2 modes for data acquisition:

- Immediate mode : You get the actual state of a device such as button 1, 2 and 5 are pressed.
- Buffered mode : Gives you the event that occured since the last time you queried the device such as button 1 was released, button 3 was pressed.

It all depends on your needs, but DirectInput is certainly worth taking a look.
circlesoft
circlesoft
Quote:
Original post by BillOB1
How accurate(in time) is DX input compared to that of the windows' default message processing system?Is there really a big difference.

DInput interfaces directly with the drivers of your devices (ie the keyboard and mouse driver). This means that it's *much* faster that Windows messaging, because you are getting the info straight from the hardware - you aren't waiting for it to go through all of the Windows processing.
BillOB1
BillOB1
Thanks a lot. I'll and try it out...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.