Sign in to follow this  
grill8

Real quick question about determining preprocessor version of DirectX.

Recommended Posts

Hello, I have a real quick question about determining the version of DirectX during preprocessing. I want to include some typedefs if (and only if) the DirectX version is version 9. I would like these to be included using preprocessor definitions. In searching the internet it seemed to be that ... #if(DIRECT3D_VERSION == 0x0900) ... #endif would be the proper solution but I could not find a definitive answer. Is the above definitively correct? Thank you for your help. Jeremy

Share this post


Link to post
Share on other sites
Looks alright to me.

Digging around in the MS provided headers should yield similar code fragments, so you can double-check there.

Off the top of my head I can't remember which, but there are definitely some of the values (I think it might just be D3DX_VERSION) aren't officially defined as such - a new SDK could change them to anything it wants thus rebuilding your code and only changing the SDK could well break. I think there are comments to this effect in the code files though.

hth
Jack

Share this post


Link to post
Share on other sites
Thank you for your help.

All I could find were snippets such as ...


#ifndef DIRECT3D_VERSION
#define DIRECT3D_VERSION 0x0900
#endif

if(DIRECT3D_VERSION >= 0x900)

...

#endif



So, I am assuming that 0x0900 means DirectX 9 when compared with DIRECT3D_VERSION but again I just simply cannot find a definitive answer that absolutely verifies this.

Thank you for your help.
Jeremy

Share this post


Link to post
Share on other sites
I think it's safe to assume that's correct. There's also DIRECTINPUT_VERSION, which is defined at 0x0800 - Since DI only goes up to v8. There's probably similar ones for the other DirectX components.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this