D3DVECTOR and D3DX_VECTOR3 ---

Started by
3 comments, last by pcbrainbuster 15 years, 11 months ago
Hello guys, What is the difference between the two types mentioned in the title? Thanks.
Advertisement
D3DVECTOR3 is a basic struct, D3DXVECTOR3 has various other member functions I believe, and inherits from D3DVECTOR3 (Although I don;t have the SDK here to check). Normally, you'd want to use D3DXVECTOR3 unless you're not using D3DX.

EDIT: From the Documentation:
Quote:This structure inherits the x, y and z members from the D3DVECTOR structure. C programmers cannot use the D3DXVECTOR3 structure. They must use the D3DVECTOR structure.

C++ programmers can take advantage of operator overloading and type casting with the D3DXVECTOR3 Extensions, which implement overloaded constructors, assignment, unary, and binary (including equality) operators.
Thanks for that but then why do functions like D3DXMatrixPerspectiveFovLH use D3DXVECTOR3 while the direction member of the D3DLIGHT9 interface use D3DVECTOR?

Thanks again.
Becouse D3DX is a set of high level library provided only for C++ programmers.
Obiously a D3DX function will use D3DX structures.

But you can also avoid using of D3DX and use normal structs.
So function that does not use D3DX library will use default version (D3DVECTOR and D3DMATRIX)
Thanks man I get it now :)

RESOLVED

This topic is closed to new replies.

Advertisement