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

WM_INPUT or DirectInput

Started by Gagyi Jan 15, 2007 at 11:31 AM 3 replies 1.5k views
Original Post
Gagyi
Gagyi
What are the pros and cons of these two? (microsoft says WM_INPUT is better, but i found DInput easier to handle)
-----------------------------------"After you finish the first 90% of a project, you have to finish the other 90%." - Michael Abrashstickman.hu <=my game (please tell me your opinion about it)
sirob
sirob
For Mice:

Drawing a cursor: Use Windows Messages. This allows your application to benifit from windows' sensitivity settings, and other useful features.
Actual game control: Probably using DInput would be easier, and that's what I usually do, but it wouldn't provide any performance benifits.

For KBs:

Text Input: Use WM. This gives you a lot of nice features, such as different keyboard set support, automagically handling caps letters, etc.

Actual Game Input: Probably DInput is easier to implement, and again, that's what I use mostly, but again, no actual performance benifits in using it, you just don't need to keep track of when a key is down and when it's up.

Hope this helps.
Sirob Yes.» - status: Work-O-Rama.
pjcast
pjcast
My advice, while a bit biased, is to use an Input System already made. In fact, I would, no surprise :), recommend my own input library for your use - Object-Orient Input System (OIS). Works under Win32 & X11/Linux. Handles keyboard, mouse, and joysticks. Gives you both event and polling API at the same time, and can also handle text (some dead keys, captial/shift handling, different locales). If you want to go this route, I recommend you grab cvs v1-0 from the sourceforge.net/projects/Wgois cvs.

I'm also surrently implementing WiiMote support (just a few threading issues to hammer out for that) in cvs head (what will be 1.1). Also, for the 1.1 release, I hope to support Xbox 360 controller (via XInput), and LIRC/WinIRC. And if easily doable, WiiMote support under Linux too.

Topic Locked

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

Sign in to reply to this topic.