Game Programming and Development Tools

Visual C++ compiler issue with D3DXMATRIX – Sturmritter

Sturmritter

Member

Posts: 17
From: San Rafael, CA, USA
Registered: 06-13-2002
Hello all, I'm trying to compare whether or not a combine matrix exists, and if so, multiplying the matrices together.

However, I'm getting an odd compiler error:

error C2666: 'D3DXMATRIX :: operator`!='' : 3 overloads have similar conversions
d:\DXSDK\include\d3dx8math.h(215): could be 'BOOL D3DXMATRIX :: operator !=(const D3DXMATRIX &) const'
or 'built-in C++ operator!=(FLOAT *, FLOAT *)'
or 'built-in C++ operator!=(const FLOAT *, const FLOAT *)'
while trying to match the argument list '(D3DXMATRIX, int)'

from the following code:

if(PropCombine1Mat != NULL )
D3DXMatrixMultiply(&PropWorldMat, &PropWorldMat, &PropCombine1Mat);

When I attempt to type-cast the compare:

if(PropCombine1Mat !=(const D3DXMATRIX &)NULL )
D3DXMatrixMultiply(&PropWorldMat, &PropWorldMat, &PropCombine1Mat);

it compiles fine, but throws an exception error in run-time.

Any helpful comments or solutions?

Thanks in advance and God bless all!

- Sturmritter


------------------

quote:
...in the immortal words of Socrates who said, "I drank WHAT?!?!?"

[This message has been edited by Sturmritter (edited July 16, 2002).]

Sturmritter

Member

Posts: 17
From: San Rafael, CA, USA
Registered: 06-13-2002
Oy veh!

It turns out that my header file for the class containing the PropCombine1Mat define a static rather than a pointer!!! ACK! (and hence the exception error when I tried to compare with another constant!)

The solution of course, was to simply define a pointer to the PropCombine1Mat.

Sometimes, late at night, I worry myself =)

Have a good 'un!

- Sturmritter

------------------

quote:
...in the immortal words of Socrates who said, "I drank WHAT?!?!?"