| 5 | #include "TextureGL.h" |
| 6 | |
| 7 | OVR_PUBLIC_FUNCTION(ovrResult) ovr_CreateTextureSwapChainGL(ovrSession session, |
| 8 | const ovrTextureSwapChainDesc* desc, |
| 9 | ovrTextureSwapChain* out_TextureSwapChain) |
| 10 | { |
| 11 | REV_TRACE(ovr_CreateTextureSwapChainGL); |
| 12 | |
| 13 | if (!desc || !out_TextureSwapChain || desc->Type != ovrTexture_2D) |
| 14 | return ovrError_InvalidParameter; |
| 15 | |
| 16 | if (!session->Compositor) |
| 17 | { |
| 18 | session->Compositor.reset(CompositorGL::Create()); |
| 19 | if (!session->Compositor) |
| 20 | return ovrError_RuntimeException; |
| 21 | } |
| 22 | |
| 23 | if (session->Compositor->GetAPI() != vr::TextureType_OpenGL) |
| 24 | return ovrError_RuntimeException; |
| 25 | |
| 26 | return session->Compositor->CreateTextureSwapChain(desc, out_TextureSwapChain); |
| 27 | } |
| 28 | |
| 29 | OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetTextureSwapChainBufferGL(ovrSession session, |
| 30 | ovrTextureSwapChain chain, |
nothing calls this directly
no test coverage detected