Jump to content
  • Advertisement

Archived

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

Enselic

DIRECTINPUT_VERSION?

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

Without defining DIRECTINPUT_VERSION theres an warning in VC++ telling me that DIRECTINPUT_VERSION is defined as the default 0x0800. Is it ok to leave it like that? Does anyone else have this warning? What is the best way to solve it?

Share this post


Link to post
Share on other sites
Advertisement
Hi,

Yes, its perfectly fine to not define your DIRECTINPUT_VERSION, the compiler just defaults to whatever''s defined in the dinput.h header...

This is whats in there that causes the warning... This is my DirectX 8 version...

#define DIRECTINPUT_HEADER_VERSION 0x0800
#ifndef DIRECTINPUT_VERSION
#define DIRECTINPUT_VERSION DIRECTINPUT_HEADER_VERSION
#pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800")
#endif

Breifly translated, if you don''t define it (#ifndef) it will define it for you to version 0x0800. Then there''s the little #pragma message thats spits out the warning message, giving you the file name and all...

Thats all it is.
If you want to use a different version, define DIRECTINPUT_VERSION differently...

Hope it helps.

Destroyer

Share this post


Link to post
Share on other sites
I don''t remember where I once read it, but MS explicitly says, that you should define the version of DI you want to use before you include the dinput.h the first time.



Buy BomberFUN online now for only EUR/USD 19,95 at http://www.bomberfun.com

Share this post


Link to post
Share on other sites
quote:
Original post by TroneX
I don''t remember where I once read it, but MS explicitly says, that you should define the version of DI you want to use before you include the dinput.h the first time.



Buy BomberFUN online now for only EUR/USD 19,95 at http://www.bomberfun.com


Yes. The reason is that an upgrade to DirectX might include a new version of DirectInput. If you don''t explicitly define the version you want, you will automatically get the new one on recompile. This could result in lots of broken code. Explicitly defining the version ensures that, regardless of the DirectX version currently installed, you will get the interface version your code expects.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!