| 200 | } |
| 201 | |
| 202 | OVR_PUBLIC_FUNCTION(ovrResult) ovr_Create(ovrSession* pSession, ovrGraphicsLuid* pLuid) |
| 203 | { |
| 204 | REV_TRACE(ovr_Create); |
| 205 | |
| 206 | if (!pSession) |
| 207 | return ovrError_InvalidParameter; |
| 208 | |
| 209 | *pSession = nullptr; |
| 210 | |
| 211 | // Initialize the opaque pointer with our own OpenXR-specific struct |
| 212 | g_Sessions.emplace_back(); |
| 213 | ovrSession session = &g_Sessions.back(); |
| 214 | |
| 215 | // Initialize session, it will not be fully usable until a swapchain is created |
| 216 | CHK_OVR(session->InitSession(g_Instance)); |
| 217 | if (pLuid) |
| 218 | *pLuid = session->Adapter; |
| 219 | *pSession = session; |
| 220 | return ovrSuccess; |
| 221 | } |
| 222 | |
| 223 | OVR_PUBLIC_FUNCTION(void) ovr_Destroy(ovrSession session) |
| 224 | { |
nothing calls this directly
no test coverage detected