dInput or no dInput?

Started by
3 comments, last by Drath 21 years, 3 months ago
Is it a good idea for me to use direct input. My prject will be keyboard and mouse based so I was wondering if I really need it considering the windows messaging system seems to work well.
Advertisement
I dont know much about the hardware-to-sofware and which is faster etc. but I can tell you that DirectInput is a must for your game. I use it for Pushed, NotPushed, and Released. You can do anything with DirectInput since you have acces to the buffer where the Data is stored. With Window Messages, you dont have acces to the Data. But if you do use the WM''s you can store them and handle them in your MainGame Loop.

Conclusion: DirectX rules.

.lick
For ALL text input use the Windows message system. The reasons are many.

For game control input in an action type game, DInput does allow you to bypass a lot of processing between the keyboard hardware and the message side. So for the absolute lowest latency on your *control* input, DInput might be preferable to you.

But Windows keyboard and mouse input is fine for most applications, particularly with things like GetAsyncKeyState() to go a bit deeper than the message system (which is queued so is never quite so direct) - DInput goes the next level deeper but not too much more.


[Just had a flash of nostalgia -: $BFEC01 and the related keyboard serial comms error handling, flag checking etc on the Amiga (just peeking the register was baaaad since it relied on OS support to tidy up the buffer mess). CIA port redirection anyone - flashing caps lock keys ahoy ]

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Can I use both, even in exclusive mode?
I think the answer is yes. S1CA says that you should use WM''s for text input and DInput for control.

.lick

This topic is closed to new replies.

Advertisement