Jump to content
  • Advertisement

Archived

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

Boltimus

Windows32 API functions vs. Directx

This topic is 6029 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

Hello all, I have a quick question that I honestly can''t answer since my experience level is low at this time. I was wondering which is more efficient/faster to run. Windows32 API functions for getting keyboard/mouse input or using direct input? Personally I lean to the windows API functions becaause they are so much easier to call, etc.. where as direct input "{frightens" me (hehe) you have to do this and call that and initialize this just to get an input (so it seems to me) Now i''m using the getcursor function in the win32 realm. Am I losing anything by doing this, is there a better way in directx? Thanks very much for your input! ~bolt

Share this post


Link to post
Share on other sites
Advertisement
DirectInput will probably be faster, because it interfaces with the hardware more directly. But IMHO input usually doesn''t need to run that fast. Using the windows functions will be fine most of the time, but you should learn DirectInput at some point - mabey for your third game or something. It''s not that hard really - look at the tutorials in the DX docs. I think there are also tutorials on NeHe (yes, I know NeHe is for OpenGL, but I think there''s a tutorial about DirectInput as well), and try NeXe as well.

John B

Share this post


Link to post
Share on other sites
when it comes to kb input, you probably can go w/ the API w/o major drawbacks. But if you want to get input from other devices (mouse, joystick) DX will save you a lot of headache (IMO). The "initialization" issue of DX is "scaring" at a first glance (because DX uses COM) but once you got a grip on it, it''s a matter of routine. There are good tutorials here on GD - have a look.

Forever trusting who we are
And nothing else matters
- Metallica

Share this post


Link to post
Share on other sites

  • 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!