への電話で回答が得られることは理解していますManager::CheckDepthStencilMatch
が、これまでのところ、この電話を効果的に行うために必要な要素を集めることができませんでした。
特に、adapterFormat
およびrenderTargetFormat
引数の値を取得する必要があります。デバイスの作成中に特定のフォーマットを指定していないため、デフォルト/現在の「フォーマット」値を取得する方法が必要です。
への電話で回答が得られることは理解していますManager::CheckDepthStencilMatch
が、これまでのところ、この電話を効果的に行うために必要な要素を集めることができませんでした。
特に、adapterFormat
およびrenderTargetFormat
引数の値を取得する必要があります。デバイスの作成中に特定のフォーマットを指定していないため、デフォルト/現在の「フォーマット」値を取得する方法が必要です。
--
D3D::DepthFormat GetDepthFormat(){
D3D::AdapterInformation ^adapter = D3D::Manager::Adapters->Default;
D3D::DepthFormat depthFormat = D3D::DepthFormat::D32;
if(!D3D::Manager::CheckDepthStencilMatch(0,
D3D::DeviceType::Hardware, adapter->CurrentDisplayMode.Format,
adapter->CurrentDisplayMode.Format, depthFormat)){
depthFormat = D3D::DepthFormat::D16;
if(!D3D::Manager::CheckDepthStencilMatch(0,
D3D::DeviceType::Hardware, adapter->CurrentDisplayMode.Format,
adapter->CurrentDisplayMode.Format, depthFormat)){
throw gcnew Exception(L"Your hardware needs to be upgraded.");
}
}
return depthFormat;
}