Jump to content
  • Advertisement
Sign in to follow this  
g_WinMain

Need DXInput?

This topic is 4355 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Some books about DX said that a game need DXInput to receive the keyboard and mouse messages,but someone told me to use Windows messages such as WM_KEYDOWN WM_LBUTTONDOWN a game need DXInput or not?

Share this post


Link to post
Share on other sites
Advertisement
you can use DirectInput but nearly everybody say not to use it. Window Messages should be the better way to go (even the DirectX SDK Documentation tells that ^^)

Share this post


Link to post
Share on other sites
Microsoft documents recommend that you do not use DirectInput for keyboard and mouse input. They still recommend using it for joystick input, though (you don't really have many other choices [smile]).

I've found that DirectInput does actually work well when you need to use relative movement of the mouse. For example, if I were to write an FPS, I'd likely use DInput for the mouse input.
I also like how DInput allows you to easily check if a key is currently down. This is also useful for FPS games (say, to check if the user is currently pressing the forward key).

All in all, IMO the best solution would be using messages for anything that requires a cursor, or for when the user needs to type text into a textbox, and Direct Input for any "real-time" input.

Hope this helps.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!