Jump to content
  • Advertisement
Sign in to follow this  
u235

Trouble setting the world transform

This topic is 3887 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

float x, y, z;

D3DXMATRIX *v;
D3DXMatrixTranslation(&v, x, y, z);

device->SetTransform(D3DTS_WORLD, &v);
The call to D3DXMatrixTranslation causes the error: cannot convert parameter 1 from 'D3DXMATRIX **__w64 ' to 'D3DXMATRIX *' and the call to device->SetTransform() causes the error: cannot convert parameter 2 from 'D3DXMATRIX **__w64 ' to 'const D3DMATRIX *' I don't believe I've ever run into this error before and I am pretty sure I've used these functions in the same manner before so I don't know why this error is coming up. If anyone can shed some light on this, I would greatly appreciate it. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
You are taking the "address of" a pointer. You rarely ever need the address of a pointer variable. Either:
1)
D3DXMATRIX* v;
D3DXMatrixTranslation(v, x, y, z);

or 2)
D3DXMATRIX v;
D3DXMatrixTranslation(&v, x, y, z);

Both of these should work. The error tells you that you were using a D3DXMATRIX** because the address of a pointer is a pointer to a pointer.

Share this post


Link to post
Share on other sites
Quote:
Original post by deh0512
You rarely ever need the address of a pointer variable.

Unless, of course, you're using DirectX, like the OP, in which case the overwhelming majority of functions that get new interfaces require the address of a pointer. Ex: IDirect3D9::CreateDevice(), IDirect3DTexture9::GetSurfaceLevel(), etc.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!