Sign in to follow this  
Axiverse

D3D9 (August) Header issues?

Recommended Posts

This is the first time I've use the august sdk (obsolete already :(... ) anyways, I've just included <d3d9.h> and it comes up with these errors:
c:\program files\microsoft directx 9.0 sdk (august 2005)\include\d3d9types.h(1791) : error C2057: expected constant expression
c:\program files\microsoft directx 9.0 sdk (august 2005)\include\d3d9types.h(1791) : warning C4200: nonstandard extension used : zero-sized array in struct/union
        Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array


Umm, here's the header in question?:
[source=cpp]
...
...
#define D3DRTYPECOUNT (D3DRTYPE_INDEXBUFFER+1)

typedef struct _D3DDEVINFO_RESOURCEMANAGER
{
    // !!!! This is the line in question:
    D3DRESOURCESTATS    stats[D3DRTYPECOUNT];
} D3DDEVINFO_RESOURCEMANAGER, *LPD3DDEVINFO_RESOURCEMANAGER;

typedef struct _D3DDEVINFO_D3DVERTEXSTATS
{
    DWORD   NumRenderedTriangles;       /* total number of triangles that are not clipped in this frame */
    DWORD   NumExtraClippingTriangles;  /* Number of new triangles generated by clipping */
} D3DDEVINFO_D3DVERTEXSTATS, *LPD3DDEVINFO_D3DVERTEXSTATS;
...
...


[edit:] Umm, for the line: #define D3DRTYPECOUNT (D3DRTYPE_INDEXBUFFER+1) D3DRTYPE_INDEXBUFFER is a enum value = 7, i think that it is saying that D3DRTYPECOUNT isn't a constant? But it is isn't it?

Share this post


Link to post
Share on other sites
This might not be the problem, but the current DX SDKs don't support Visual C++ version 6. Other than that... maybe you aren't including the headers in a correct order?

Share this post


Link to post
Share on other sites
I am using VC++ 8.0 Express Beta 2, and the only include statement that I have is the following:

#include <d3d9.h>

So, i don't think that's the problem...
WIN32_LEAN_AND_MEAN should not affect it, should it?

[edit]

I've changed D3DRTYPECOUNT to 8 (which is it's value) and it compiles fine now.. It's a workaround, but I'm sure it's not good...

Share this post


Link to post
Share on other sites
It seems you are compiling your code as C code.
Using a constant value as a previously defined constant is valid in C++, not in C. And warning C4200 is a level 2 warning in C, and a level 4 warning in C++. Assuming default warning level is 3 (/W3), you seems to be using C compilation ;)

Try to change to C++, it should work fine then :)

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