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

Function ovr_CreateMirrorTextureGL

ReviveXR/REV_CAPI_GL.cpp:73–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73OVR_PUBLIC_FUNCTION(ovrResult) ovr_CreateMirrorTextureGL(ovrSession session,
74 const ovrMirrorTextureDesc* desc,
75 ovrMirrorTexture* out_MirrorTexture)
76{
77 REV_TRACE(ovr_CreateMirrorTextureGL);
78
79 if (!session)
80 return ovrError_InvalidSession;
81
82 if (!desc || !out_MirrorTexture)
83 return ovrError_InvalidParameter;
84
85 ovrMirrorTexture mirrorTexture = new ovrMirrorTextureData();
86 mirrorTexture->Desc = *desc;
87 *out_MirrorTexture = mirrorTexture;
88
89 ovrTextureSwapChainDesc swapDesc;
90 swapDesc.Type = ovrTexture_2D;
91 swapDesc.Format = desc->Format;
92 swapDesc.ArraySize = 1;
93 swapDesc.Width = desc->Width;
94 swapDesc.Height = desc->Height;
95 swapDesc.MipLevels = 1;
96 swapDesc.SampleCount = 1;
97 swapDesc.StaticImage = ovrTrue;
98 swapDesc.MiscFlags = desc->MiscFlags;
99 swapDesc.BindFlags = 0;
100 return ovr_CreateTextureSwapChainGL(session, &swapDesc, &mirrorTexture->Dummy);
101}
102
103
104OVR_PUBLIC_FUNCTION(ovrResult) ovr_CreateMirrorTextureWithOptionsGL(ovrSession session,

Callers 1

Calls 1

Tested by

no test coverage detected