| 95 | } |
| 96 | |
| 97 | OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetMirrorTextureBufferDX(ovrSession session, |
| 98 | ovrMirrorTexture mirrorTexture, |
| 99 | IID iid, |
| 100 | void** out_Buffer) |
| 101 | { |
| 102 | REV_TRACE(ovr_GetMirrorTextureBufferDX); |
| 103 | |
| 104 | if (!session) |
| 105 | return ovrError_InvalidSession; |
| 106 | |
| 107 | if (!mirrorTexture || !out_Buffer) |
| 108 | return ovrError_InvalidParameter; |
| 109 | |
| 110 | TextureD3D* texture = dynamic_cast<TextureD3D*>(mirrorTexture->Texture.get()); |
| 111 | if (!texture) |
| 112 | return ovrError_InvalidParameter; |
| 113 | |
| 114 | HRESULT hr = texture->Texture()->QueryInterface(iid, out_Buffer); |
| 115 | if (FAILED(hr)) |
| 116 | return ovrError_InvalidParameter; |
| 117 | |
| 118 | return ovrSuccess; |
| 119 | } |