| 71 | } |
| 72 | |
| 73 | OVR_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 | |
| 104 | OVR_PUBLIC_FUNCTION(ovrResult) ovr_CreateMirrorTextureWithOptionsGL(ovrSession session, |
no test coverage detected