MCPcopy Create free account
hub / github.com/LibreVR/Revive / ovr_CreateMirrorTextureDX

Function ovr_CreateMirrorTextureDX

ReviveXR/REV_CAPI_D3D.cpp:257–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257OVR_PUBLIC_FUNCTION(ovrResult) ovr_CreateMirrorTextureDX(ovrSession session,
258 IUnknown* d3dPtr,
259 const ovrMirrorTextureDesc* desc,
260 ovrMirrorTexture* out_MirrorTexture)
261{
262 REV_TRACE(ovr_CreateMirrorTextureDX);
263
264 if (!session)
265 return ovrError_InvalidSession;
266
267 if (!d3dPtr || !desc || !out_MirrorTexture)
268 return ovrError_InvalidParameter;
269
270 ovrMirrorTexture mirrorTexture = new ovrMirrorTextureData();
271 mirrorTexture->Desc = *desc;
272 *out_MirrorTexture = mirrorTexture;
273
274 ovrTextureSwapChainDesc swapDesc;
275 swapDesc.Type = ovrTexture_2D;
276 swapDesc.Format = desc->Format;
277 swapDesc.ArraySize = 1;
278 swapDesc.Width = desc->Width;
279 swapDesc.Height = desc->Height;
280 swapDesc.MipLevels = 1;
281 swapDesc.SampleCount = 1;
282 swapDesc.StaticImage = ovrTrue;
283 swapDesc.MiscFlags = desc->MiscFlags;
284 swapDesc.BindFlags = 0;
285 return ovr_CreateTextureSwapChainDX(session, d3dPtr, &swapDesc, &mirrorTexture->Dummy);
286}
287
288OVR_PUBLIC_FUNCTION(ovrResult) ovr_CreateMirrorTextureWithOptionsDX(ovrSession session,
289 IUnknown* d3dPtr,

Callers 1

Calls 1

Tested by

no test coverage detected