XMLoadColor

Loads an XMCOLOR into an XMVECTOR.

Syntax

XMVECTOR XMLoadColor(
         const XMCOLOR *pSource
)  

Parameters

pSource
Type: XMCOLOR *

[in]

Address of the XMCOLOR structure to load.

Return value

Type: XMVECTOR 

Returns an XMVECTOR loaded with the data from the pSource parameter with X containing the Red color channel, Y containing the Green, Z the Blue, and W the Alpha channel. The values in the components range from 0 to 1.

Remarks

The following pseudocode demonstrates the operation of the function.

XMVECTOR vectorOut;

vectorOut.x = (float)((pSource->c >> 16) & 0xFF) / 255.0f;
vectorOut.y = (float)((pSource->c >> 8) & 0xFF) / 255.0f;
vectorOut.z = (float)((pSource->c >> 0) & 0xFF) / 255.0f;
vectorOut.w = (float)((pSource->c >> 24) & 0xFF) / 255.0f;

return vectorOut;  

Requirements

Header: Declared in directxpackedvector.h.