D3D_FEATURE_LEVEL featureLevel;
HRESULT hr = D3D11CreateDevice(
0, // default adapter
md3dDriverType,
0, // no software device
createDeviceFlags,
0, 0, // default feature level array
D3D11_SDK_VERSION,
&md3dDevice,
&featureLevel,
&md3dImmediateContext);
if( FAILED(hr) )
{
MessageBox(0, L"D3D11CreateDevice Failed.", 0, 0);
return false;
}
switch( featureLevel )
{
case D3D_FEATURE_LEVEL_11_0:
MessageBox(0, L"Direct3D Feature Level 11 supported.", 0, 0);
break;
case D3D_FEATURE_LEVEL_10_1:
MessageBox(0, L"Direct3D Feature Level 10.1 supported.", 0, 0);
break;
case D3D_FEATURE_LEVEL_10_0:
MessageBox(0, L"Direct3D Feature Level 10.0 supported.", 0, 0);
break;
case D3D_FEATURE_LEVEL_9_3:
MessageBox(0, L"Direct3D Feature Level 9.3 supported.", 0, 0);
break;
case D3D_FEATURE_LEVEL_9_2:
MessageBox(0, L"Direct3D Feature Level 9.2 supported.", 0, 0);
break;
case D3D_FEATURE_LEVEL_9_1:
MessageBox(0, L"Direct3D Feature Level 9.1 supported.", 0, 0);
break;
default:
MessageBox(0, L"If you were a cow, this would be utter failure.", 0, 0);
return false;
}
沒有留言:
張貼留言