A 2D vector where each component is a signed integer, 8-bits (1 byte) in length.
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.
struct XMBYTE2
The fields in the XMBYTE2 structure are declared as follows:
struct XMBYTE2
{
union
{
struct
{
int8_t x; // Signed 8-bit integer value in the range [-127, 127]
// describing the x-coordinate of the vector.
int8_t y; // Signed 8-bit integer value in the range [-127, 127]
// describing the y-coordinate of the vector.
};
uint16_t v; // Unsigned 16-bit integer representing the 2D vector.
};
You can use XMLoadByte2 to load XMBYTE2 into instances of XMVECTOR.
You can use XMStoreByte2 to store instances of XMVECTOR into an instance of XMBYTE2.
Namespace: Use DirectX::PackedVector
Header: Declared in directxpackedvector.h.