Skip to main content
GameDev.net gamedev.net
🔒 Locked

D3DVECTOR and D3DX_VECTOR3 ---

Started by pcbrainbuster May 10, 2008 at 12:59 PM 3 replies 1.9k views
Original Post
pcbrainbuster
pcbrainbuster
Hello guys, What is the difference between the two types mentioned in the title? Thanks.
Evil Steve
Evil Steve
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.
pcbrainbuster
pcbrainbuster
Thanks for that but then why do functions like D3DXMatrixPerspectiveFovLH use D3DXVECTOR3 while the direction member of the D3DLIGHT9 interface use D3DVECTOR?

Thanks again.
XVincentX
XVincentX
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)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.