XMVECTOR Structure

A portable type used to represent a vector of four 32-bit floating-point or integer components, each aligned optimally and mapped to a hardware vector register.

Syntax

struct XMVECTOR  

Remarks

If you are programming in C++, you can use the methods of this structure.

In the DirectXMath Library, to fully support portability and optimization, XMVECTOR is, by design, an opaque type. The actual implementation of XMVECTOR is platform dependent.

In general, code should not rely on the specifics of any given platform specific implementation of XMVECTOR. Platform-specific implementations have these characteristics:

Developers should use DirectXMath Library’s accessor, load, and store functions to get and set the vectors, and the DirectXMath Library 4D Vector Functions to manipulate them.

For projects that need detailed information about how to implement XMVECTOR on different platforms, see Library Internals.

Compiler Aliases

The DirectXMath.h header file uses aliases to the XMVECTOR object, specifically CXMVECTOR and FXMVECTOR. The header uses these aliases to comply with the optimal in-line calling conventions of different compilers. For most projects that use DirectXMath it is sufficient to treat these types as an exact alias to XMVECTOR.

For example:

[CDATA[
typedef const XMVECTOR FXMVECTOR;
typedef const XMVECTOR CXMVECTOR;
] ]  

For projects that need detailed information about how different platforms handle their calling conventions, see Library Internals.

For XNAMATH 2.x, the XMVECTOR data type has .x, .y, .z, .and .w element members, which generally cause poor performance. The use of the XM_STRICT_VECTOR4 type provides an opt-in of the DirectXMath definition of an opaque data type.