本文整理汇总了C++中DeviceManager::GetDevice方法的典型用法代码示例。如果您正苦于以下问题:C++ DeviceManager::GetDevice方法的具体用法?C++ DeviceManager::GetDevice怎么用?C++ DeviceManager::GetDevice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DeviceManager
的用法示例。
在下文中一共展示了DeviceManager::GetDevice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: make_argument_exception
RasterizerState::RasterizerState (const DeviceManager& manager, const RasterizerDesc& in_desc)
: DeviceObject (manager)
, desc (in_desc)
{
try
{
//преобразование дескриптора
D3D11_RASTERIZER_DESC dx_desc;
memset (&dx_desc, 0, sizeof (dx_desc));
dx_desc.FrontCounterClockwise = desc.front_counter_clockwise;
dx_desc.DepthBias = desc.depth_bias;
dx_desc.DepthBiasClamp = 0.0f;
dx_desc.DepthClipEnable = TRUE;
dx_desc.SlopeScaledDepthBias = 0.0f;
dx_desc.MultisampleEnable = desc.multisample_enable;
dx_desc.ScissorEnable = desc.scissor_enable;
dx_desc.AntialiasedLineEnable = desc.antialiased_line_enable;
switch (desc.fill_mode)
{
case FillMode_Wireframe:
dx_desc.FillMode = D3D11_FILL_WIREFRAME;
break;
case FillMode_Solid:
dx_desc.FillMode = D3D11_FILL_SOLID;
break;
default:
throw xtl::make_argument_exception ("", "desc.fill_mode", desc.fill_mode);
}
switch (desc.cull_mode)
{
case CullMode_None:
dx_desc.CullMode = D3D11_CULL_NONE;
break;
case CullMode_Front:
dx_desc.CullMode = D3D11_CULL_FRONT;
break;
case CullMode_Back:
dx_desc.CullMode = D3D11_CULL_BACK;
break;
default:
throw xtl::make_argument_exception ("", "desc.cull_mode", desc.cull_mode);
}
//создание состояния
ID3D11RasterizerState* dx_state = 0;
check_errors ("ID3D11Device::CreateRasterizerState", manager.GetDevice ().CreateRasterizerState (&dx_desc, &dx_state));
if (!dx_state)
throw xtl::format_operation_exception ("", "ID3D11Device::CreateRasterizerState failed");
state = DxRasterizerStatePtr (dx_state, false);
}
catch (xtl::exception& e)
{
e.touch ("render::low_level::dx11::RasterizerState::RasterizerState");
throw;
}
}