XMUBYTE2 Structure

Describes a 2D vector where each component is a unsigned integer, 8-bits (1 byte) in length.

A 2D vector where each component is a unsigned 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.

Syntax

struct XMUBYTE2  

Remarks

The fields in the XMUBYTE2 structure are declared as follows:

struct XMUBYTE2
{
    union
    {
        struct
        {
            uint8_t x; // Unsigned 8-bit integer value in the range [0, 255] 
                       // describing the x-coordinate of the vector.
            uint8_t y; // Unsigned 8-bit integer value in the range [0, 255] 
                       // describing the y-coordinate of the vector.
        };
        uint16_t v; // Unsigned 16-bit integer representing the 2D vector.
    };  

You can use XMLoadUByte2 to load XMUBYTE2 into instances of XMVECTOR.

You can use XMStoreUByte2 to store instances of XMVECTOR into an instance of XMUBYTE2.

Namespace: Use DirectX::PackedVector

Requirements

Header: Declared in directxpackedvector.h.