Real quick question about determining preprocessor version of DirectX.

Started by
2 comments, last by Evil Steve 15 years, 11 months ago
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
Advertisement
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Thank you for your help.

All I could find were snippets such as ...

#ifndef DIRECT3D_VERSION#define DIRECT3D_VERSION 0x0900#endifif(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

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.

This topic is closed to new replies.

Advertisement