本文整理汇总了C++中microsoft::wrl::ComPtr::SetCenterX方法的典型用法代码示例。如果您正苦于以下问题:C++ ComPtr::SetCenterX方法的具体用法?C++ ComPtr::SetCenterX怎么用?C++ ComPtr::SetCenterX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类microsoft::wrl::ComPtr
的用法示例。
在下文中一共展示了ComPtr::SetCenterX方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FlipVisual
// Apply a 3D flip for hit-tested tile visual
HRESULT Application::FlipVisual(int visualIndex)
{
HRESULT hr = S_OK;
Microsoft::WRL::ComPtr<IDCompositionAnimation> dcompAngleAnimation;
if (SUCCEEDED(hr))
{
hr = _dcompDevice->CreateAnimation(&dcompAngleAnimation);
}
if (SUCCEEDED(hr))
{
hr = dcompAngleAnimation->AddCubic(0.0, 0.0f, 180.0f, 0.0f, 0.0f);
}
if (SUCCEEDED(hr))
{
hr = dcompAngleAnimation->End(1.0, 180.0f);
}
Microsoft::WRL::ComPtr<IDCompositionRotateTransform3D> dcompFlipTransform;
if (SUCCEEDED(hr))
{
hr = _dcompDevice->CreateRotateTransform3D(&dcompFlipTransform);
}
if (SUCCEEDED(hr))
{
hr = dcompFlipTransform->SetCenterX(1.0f * _hWndClientWidth / 8.0f);
}
if (SUCCEEDED(hr))
{
hr = dcompFlipTransform->SetCenterY(1.0f * _hWndClientHeight / 8.0f);
}
if (SUCCEEDED(hr))
{
hr = dcompFlipTransform->SetCenterZ(0.0f);
}
if (SUCCEEDED(hr))
{
hr = dcompFlipTransform->SetAxisX(0.0f);
}
if (SUCCEEDED(hr))
{
hr = dcompFlipTransform->SetAxisY(1.0f);
}
if (SUCCEEDED(hr))
{
hr = dcompFlipTransform->SetAxisZ(0.0f);
}
if (SUCCEEDED(hr))
{
hr = dcompFlipTransform->SetAngle(dcompAngleAnimation.Get());
}
if (SUCCEEDED(hr))
{
hr = _dcompTileVisuals[visualIndex]->SetEffect(dcompFlipTransform.Get());
}
if (SUCCEEDED(hr))
{
hr = _dcompDevice->Commit();
}
return hr;
}