XMStoreSInt2 函数 (directxmath.h)

XMVECTOR 中的有符号整数数据存储在 XMINT2 结构中。

语法

void XM_CALLCONV XMStoreSInt2(
  [out] XMINT2    *pDestination,
        FXMVECTOR V
) noexcept;

参数

[out] pDestination

要在其中存储数据的 XMINT2 结构的地址。

V

包含要存储的数据的向量。

返回值

无。

备注

对于 16 字节对齐内存,将 XMStoreInt2A 与强制转换运算符结合使用可能更快。

以下伪代码显示了此函数的操作。


XMVECTOR N;	

assert(pDestination);

N = XMVectorClamp(V, MinInt, MaxInt );
N = XMVectorRound(N);

pDestination->x = (int32_t)N.v[0];
pDestination->y = (int32_t)N.v[1];

    

平台要求

带有 Windows SDK for Windows 8 的 Microsoft Visual Studio 2010 或 Microsoft Visual Studio 2012。 支持 Win32 桌面应用、Windows 应用商店应用和 Windows Phone 8 应用。

要求

   
目标平台 Windows
标头 directxmath.h

请参阅

DirectXMath 库矢量存储函数