Skip to main content
gamedev.net
🔒 Locked

DirectInput

Started by LevyDee 4 replies 800+ views
Original Post
LevyDee
LevyDee
Im doing a little research and am thinking about undertaking a personal project of creating a game engine. So i did a little bit of research on DirectInput to handle that sort of thing, and on msdn, it says DirectInput is not suggested for keyboard and mouse and instead should use the normal window Proc to handle events. Why does it say this, and in your guy's opinion, is this true? Thanks
SiS-Shadowman
SiS-Shadowman
Because DirectInput is way harder to use than to simply intersect key press/release messages. On top of that, it creates a thread for that purpose.

So yes, their suggestion (which you should follow most, if not all, of the time) is the right one. Simply drop DirectInput and let it rot in a corner... ;)
LevyDee
LevyDee
Thanks for the response guys.
21st Century Moose
21st Century Moose
For keyboard input you definitely shouldn't use it. For mouse input it's OK, provided that you know, understand and accept that it's behaviour is what you want. If that's the case then it's still a solid enough and respectable enough API that will handle a lot of things (such as hiding the mouse cursor, disabling acceleration, clipping to the window rect, etc) automatically for you. So if that's desirable behaviour and if you don't want to have to write your own code to handle it, then by all means it's perfectly fine.

Note that you can easily use DI for mouse input but still use Windows messaging for keyboard input. It's not a case of all or nothing.
Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls. 
Endemoniada
Endemoniada
I'm still using it for gamepad input, I guess I have no other choice ?

Topic Locked

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

Sign in to reply to this topic.