XMSHORT2 Structure

Describes a 2D vector consisting of 16-bit signed and normalized integer components.

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 XMSHORT2  

Remarks

The fields in the XMSHORT2 structure are declared as follows:

struct XMSHORT2
{
    union
    {
        struct
        {
            int16_t x; // Signed integer in the range [-32767, 32767] 
                       // describing the x-coordinate of the vector.
            int16_t y; // Signed integer in the range [-32767, 32767] 
                       // describing the y-coordinate of the vector.
        };
        uint32_t v; // Unsigned 32-bit integer representing the 2D vector.
    };  

The components are normalized when this structure is loaded into an XMVECTOR using XMLoadShort2. Each component will be divided by 32767.0f.

Namespace: Use DirectX::PackedVector

Requirements

Header: Declared in directxpackedvector.h.