Windows Dev Center

XMConvertFloatToHalfStream
XMConvertHalfToFloatStream
XMMatrixDecompose
XMPlaneTransformStream
XMVector2TransformCoordStream
XMVector2TransformNormalStream
XMVector2TransformStream
XMVector3ProjectStream
XMVector3TransformCoordStream
XMVector3TransformNormalStream
XMVector3TransformStream
XMVector3UnprojectStream
XMVector4TransformStream
Expand Minimize

XMLoadColor method

Loads an XMCOLOR into an XMVECTOR.

Syntax


XMVECTOR XMLoadColor(
  [inconst XMCOLOR *pSource
);

Parameters

pSource [in]

Address of the XMCOLOR structure to load.

Return value

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;

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

Namespace

DirectX::PackedVector

Header

DirectXPackedVector.h

 

 

Community Additions

ADD
Show:
© 2015 Microsoft