DIRECTINPUT_VERSION?

Started by
4 comments, last by Enselic 20 years, 12 months ago
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?
[s]--------------------------------------------------------[/s]chromecode.com - software with source code
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
Cleared things up, thanks!
[s]--------------------------------------------------------[/s]chromecode.com - software with source code
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
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.
you can just comment out the line in dInput.h and *Poof* no more warning

This topic is closed to new replies.

Advertisement