| 7 | #include <d3d11.h> |
| 8 | |
| 9 | OVR_PUBLIC_FUNCTION(ovrResult) ovr_CreateTextureSwapChainDX(ovrSession session, |
| 10 | IUnknown* d3dPtr, |
| 11 | const ovrTextureSwapChainDesc* desc, |
| 12 | ovrTextureSwapChain* out_TextureSwapChain) |
| 13 | { |
| 14 | REV_TRACE(ovr_CreateTextureSwapChainDX); |
| 15 | |
| 16 | if (!session) |
| 17 | return ovrError_InvalidSession; |
| 18 | |
| 19 | if (!d3dPtr || !desc || !out_TextureSwapChain) |
| 20 | return ovrError_InvalidParameter; |
| 21 | |
| 22 | if (!session->Compositor) |
| 23 | { |
| 24 | session->Compositor.reset(CompositorD3D::Create(d3dPtr)); |
| 25 | if (!session->Compositor) |
| 26 | return ovrError_RuntimeException; |
| 27 | } |
| 28 | |
| 29 | if (session->Compositor->GetAPI() != vr::TextureType_DirectX) |
| 30 | return ovrError_RuntimeException; |
| 31 | |
| 32 | return session->Compositor->CreateTextureSwapChain(desc, out_TextureSwapChain); |
| 33 | } |
| 34 | |
| 35 | OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetTextureSwapChainBufferDX(ovrSession session, |
| 36 | ovrTextureSwapChain chain, |
nothing calls this directly
no test coverage detected