XMHALF2 Structure

A 2D vector consisting of two half-precision (16bit) floating-point values.

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

Note See DirectXMath Library Type Equivalences for information about equivalent D3DDECLTYPE, D3DFORMAT, and DXGI_FORMAT objects.

Syntax

struct XMHALF2  

Remarks

The fields in the XMHALF2 structure are declared as follows:

struct XMHALF2
{
    union
    {
        struct
        {
            HALF x; // HALF value describing the x-coordinate.
            HALF y; // HALF value describing the y-coordinate.
        };
        uint32_t v; // Unsigned 32-bit integer representing the 2D vector.
    };  

The definition of the HALF type used under DirectXMath is consistent with the IEEE standard, and consists of a sign bit, a 5 bit biased exponent, and a 10 bit mantissa:

[15] SEEEEEMMMMMMMMMM [0]  

XMHALF2 can be loaded into instances of XMVECTOR by using XMLoadHalf2.

Instances of XMVECTOR can be stored into an instance of XMHALF2 with XMStoreHalf2.

Namespace: Use DirectX::PackedVector

Requirements

Header: Declared in directxpackedvector.h.