Archived

This topic is now archived and is closed to further replies.

hello_there

direct input is it worth it?

Recommended Posts

hmm...
I got it up and working pretty quickly when I added it to the
project I''m working on...
I also find it fairly easy to use.

Anything you''re having trouble with?

-Hyatus
"da da da"

Share this post


Link to post
Share on other sites
quote:
Original post by hello_there
put to use direct input you have to declare class and stuff. but if you use GetAsyncKeyState(); it''s realy easy.

And what does GetAsyncKeyState give you? Do you get the same level of functionality? Do you get joystick support? Mouse? Multiple simultaneous keypresses? Support for throttles, hatches, yokes? Device and device object enumeration?

I think not.

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!

Share this post


Link to post
Share on other sites
Well said Oluseyi!

I agree with you on this one, direct input is a very powerful tool, and isn''t that tricky to set up. There are plenty of tutorials on the internet if anybody is stuck. Another advantage is that Direct Input is faster than "GetAsyncKeyState()" as it operates closer to the hardware, with fewer abstraction levels.

My advice...

-If you are making a small demo application, use GetAsyncKeyState(), coz its easier.
-If you are making ANY sort of game or engine, go with Direct Input, coz its better.

-Weasalmongler

Share this post


Link to post
Share on other sites
The best thing to do is not tie direct-input directly with your code. Use an abstraction layer. That way, if the user doesn''t have direct input then they can use a different input driver. It will also make porting the game to platforms without directx much easier.

Share this post


Link to post
Share on other sites
I can point you to my DirectInput wrapper, which you can download from this page. It''s very small, is open source, and is under a very free license (Zlib''s, which lets you do whatever you want with the code, even use it for commercial stuff, and only having to credit me if you ever release the sources... more info is in the site itself).

However, take into account that a new version of that wrapper is coming soon (the same for my DirectDraw wrapper -expect big changes here-, and the first release of my Audio Library)... I''m not sure how much time it will take to me to release the new versions, maybe I''ll be doing so next week or so...

If you want to be noticed by mail every time a new version is released, go join my site''s newsletter.


--DK
--H. Hernán Moraldo
http://www.hhm.com.ar/
Sign up to the HHM''s developers'' newsletter.

Share this post


Link to post
Share on other sites