1

への電話で回答が得られることは理解していますManager::CheckDepthStencilMatchが、これまでのところ、この電話を効果的に行うために必要な要素を集めることができませんでした。

特に、adapterFormatおよびrenderTargetFormat引数の値を取得する必要があります。デバイスの作成中に特定のフォーマットを指定していないため、デフォルト/現在の「フォーマット」値を取得する方法が必要です。

4

1 に答える 1

1

--

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;
}
于 2010-02-05T11:04:19.127 に答える