Jump to content
  • Advertisement
Sign in to follow this  
BGhost

Error in Direct3D program

This topic is 4281 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!