Jump to content
  • Advertisement

Archived

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

ITH3

Direct Input trouble

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

Hi, I''m having a little trouble setting up direct input. The code i''m using is: if(FAILED(DirectInputCreate(hInst, DIRECTINPUT_VERSION, &lpdi, NULL))) { return FALSE; } I am including dinput.h and dinput.lib and get the following error: ''DirectInputCreate'' : undeclared identifier. I''m using DX 8.0 . Thanks

Share this post


Link to post
Share on other sites
Advertisement
I think the function in DX8 is ''DirectInput8Create''. Looks like you forgot the ''8'' between ''Input'' and ''Create''. Also, I think(still not fully sure) that when trying to use an older version of DirectInput, you need to define what version you want. For example #define DIRECTINPUT_VERSION 0x0300 . Hope this helps!

"I kinda think, therefore, I kinda... am?"

Share this post


Link to post
Share on other sites
Thanks for the reply. A different error comes up now while using DirectInput8Create: ''DirectInput8Create'' : function does not take 4 parameters. What are the parameters for DirectInput8Create? BTW DirectInput8Create doesn''t come up in the MSDN Library. Thanks

Share this post


Link to post
Share on other sites
Had the exact same problem.

In your link settings, make sure you have "dinput8.lib" NOT "dinput.lib"...

This should fix everything.

Have a blast.

-----------------
The Goblin
-----------------
"Oh, God..."
"Yes?" <- My Response

Share this post


Link to post
Share on other sites
Check on the developer docs you ought to have got with the DirectX 8 SDK, that should tell you all you need to know about parameters. It also has some helpful tutorials (well, helpful in a relative sense...) that could sort out your problem.

I''d give you the info myself, but I''m just fresh off a format and nothing is installed


-Mezz

P.S. If you don''t have the DirectX 8 docs, you can get them online at M$''s website.

Share this post


Link to post
Share on other sites
If you want to use a version of DirectInput that is not version 8, you do not need to change to version 8. Keep all your existing code, and just add to the top of every file you include dinput.h in the following define (make sure that you do it before you include dinput.h)
#define DIRECTINPUT_VERSION 0x0300
Then DirectInput will work as if you have version 1 of directinput. That is all that you need to do.



Just because you''re outnumbered doesn''t mean you''re wrong.


sharewaregames.20m.com

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!