XMSHORT2 structure (directxpackedvector.h)

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

For a list of additional functionality such as constructors and operators that are available using XMSHORT2 when you are programming in C++, see XMSHORT2 Extensions.

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

Syntax

struct XMSHORT2 {
  union {
    struct {
      int16_t x;
      int16_t y;
    };
    uint32_t v;
  };
  void                 XMSHORT2();
  void                 XMSHORT2(
    const XMSHORT2 & 
  );
  XMSHORT2 &           operator=(
    const XMSHORT2 & 
  );
  void                 XMSHORT2(
    XMSHORT2 && 
  );
  XMSHORT2 &           operator=(
    XMSHORT2 && 
  );
  noexcept             XMSHORT2(
    uint32_t Packed
  );
  noexcept             XMSHORT2(
    int16_t _x,
    int16_t _y
  );
  noexcept             XMSHORT2(
    const int16_t *pArray
  );
  noexcept             XMSHORT2(
    float _x,
    float _y
  );
  noexcept             XMSHORT2(
    const float *pArray
  );
  XMSHORT2 &  noexcept operator=(
    uint32_t Packed
  );
};

Members

x

Signed integer in the range [-32767, 32767] describing the x-coordinate of the vector.

y

Signed integer in the range [-32767, 32767] describing the y-coordinate of the vector.

v

void XMSHORT2()

Default constructor for XMSHORT2.

Default constructor for XMSHORT2.

Note  This constructor is only available under C++.
 

void XMSHORT2( const XMSHORT2 & )

A constructor for XMSHORT2.

A constructor for XMSHORT2.

Note  This constructor is only available under C++.

XMSHORT2 & operator=( const XMSHORT2 & )

Assigns the vector component data from one instance of XMSHORT2 to the current instance of XMSHORT2.

This operator assigns the vector component data from one instance of XMSHORT2 to the current instance of XMSHORT2.

Note  This operator is only available under C++.

void XMSHORT2( XMSHORT2 && )

A constructor for XMSHORT2.

A constructor for XMSHORT2.

Note  This constructor is only available under C++.

XMSHORT2 & operator=( XMSHORT2 && )

noexcept XMSHORT2( uint32_t Packed)

A constructor for XMSHORT2.

A constructor for XMSHORT2.

Note  This constructor is only available under C++.

noexcept XMSHORT2( int16_t _x, int16_t _y)

Initializes a new instance of XMSHORT2 from two int16_t arguments.

This constructor initializes a new instance of XMSHORT2 from two int16_t arguments.

Note  This constructor is only available under C++.
 

noexcept XMSHORT2( const int16_t *pArray)

Initializes a new instance of XMSHORT2 from a two element int16_t array argument.

This constructor initializes a new instance of XMSHORT2 from a two element int16_t array argument.

Note  This constructor is only available under C++.

noexcept XMSHORT2( float _x, float _y)

Initializes a new instance of XMSHORT2 from two float arguments.

This constructor initializes a new instance of XMSHORT2 from two float arguments.

Note  This constructor is only available under C++.
 

noexcept XMSHORT2( const float *pArray)

Initializes a new instance of XMSHORT2 from a two element float array argument.

This constructor initializes a new instance of XMSHORT2 from a two element float array argument.

Note  This constructor is only available under C++.

XMSHORT2 & noexcept operator=( uint32_t Packed)

Remarks

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

Platform Requirements

Microsoft Visual Studio 2010 or Microsoft Visual Studio 2012 with the Windows SDK for Windows 8. Supported for Win32 desktop apps, Windows Store apps, and Windows Phone 8 apps.

Requirements

   
Header directxpackedvector.h

See also

DirectXMath Library Structures

XMSHORT2 Extensions