Sign in to follow this  
BGhost

Error in Direct3D program

Recommended Posts

Hello I wrote a program for draw Squre with Direct3D in VC++ 7.0. when compile it, get 2 message error: error C2664: 'D3DXMatrixLookAtLH' : cannot convert parameter 1 from 'D3DMATRIX *__w64 ' to 'D3DXMATRIX *' and error C2664: 'D3DXMatrixPerspectiveFovLH' : cannot convert parameter 1 from 'D3DMATRIX *__w64 ' to 'D3DXMATRIX *' these are 2 line of my codes that have error: D3DXMatrixLookAtLH(&view_matrix,&D3DXVECTOR3(0.0f,0.0f,10.0f),&D3DXVECTOR3(0.0f,0.0f,0.0f),&D3DXVECTOR3(0.0f,1.0f,0.0f)); and D3DXMatrixPerspectiveFovLH(&matProj,D3DX_PI/4,1.33,1.0f,100.0f); please guide me.

Share this post


Link to post
Share on other sites
maybe its your matrix declaration. Here's an example that works:

D3DXMATRIXA16 mlightProj;
D3DXMatrixPerspectiveFovLH(&mlightProj,D3DX_PI/4,1.0f, 0.1f, 50.0f );

no errors, and works perfectly. hope this helps.

Share this post


Link to post
Share on other sites
While I've never run into exactly this problem myself (never having had a 64-bit processor and OS), it appears that you're compiling in 64-bit mode, but are using 32-bit DirectX libraries. I'm not entirely sure what to do to fix that, but perhaps you actually don't mean to be compiling in 64-bit mode, and could thus probably change that in the compiler section of your project settings.

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