Skip to main content
gamedev.net
🔒 Locked

DIRECTINPUT_VERSION?

Started by Enselic Apr 21, 2003 at 12:42 PM 4 replies 1.4k views
Original Post
Enselic
Enselic
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?
Destroyer
Destroyer
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
TroneX
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
Dave Hunt
Dave Hunt
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.
Buster
Buster
you can just comment out the line in dInput.h and *Poof* no more warning

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.