Is it safe to use the same parameters for input and output in D3DX functions?

Posted by JB on Stack Overflow See other posts from Stack Overflow or by JB
Published on 2010-03-24T10:23:56Z Indexed on 2010/03/24 14:53 UTC
Read the original article Hit count: 272

Filed under:
|

Using the D3DX library that is a part of directX, specifically directx9 in this case, I'm wondering if it's safe to use the same matrix (or vector etc) for input and ouput

D3DXMATRIX mat;
D3DXMatrixInverse(&mat, NULL, &mat);

I've been avoiding doing so, assuming that it would result in bad things happening when parts of the array got partly overwritten as results are calculated but I see an awful lot of code around that does exactly this.

A brief test indicates that it seems to work ok, so I'm assuming that the D3DX functions take a copy where necessary of the input data, or some other method to ensure that this works ok, but I can't find it documented anywhere so I'm reluctant to rely on it working.

Is there any official statement on using the functions like this?

© Stack Overflow or respective owner

Related posts about directx

Related posts about d3dx