Loads an XMCOLOR into an XMVECTOR.
XMVECTOR XMLoadColor(
const XMCOLOR *pSource
)
pSource
Type: XMCOLOR *
[in]
Address of the XMCOLOR structure to load.
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.
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;
Header: Declared in directxpackedvector.h.