| 275 | } ovrSessionStatus1; |
| 276 | |
| 277 | OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetSessionStatus(ovrSession session, ovrSessionStatus* sessionStatus) |
| 278 | { |
| 279 | REV_TRACE(ovr_GetSessionStatus); |
| 280 | |
| 281 | if (!session) |
| 282 | return ovrError_InvalidSession; |
| 283 | |
| 284 | if (!sessionStatus) |
| 285 | return ovrError_InvalidParameter; |
| 286 | |
| 287 | session->UpdateStatus(); |
| 288 | |
| 289 | if (g_MinorVersion > 20) |
| 290 | *sessionStatus = session->Status; |
| 291 | else |
| 292 | memcpy(sessionStatus, &session->Status, sizeof(ovrSessionStatus1)); |
| 293 | |
| 294 | // Detect if the application has focus, but return false the first time the status is requested. |
| 295 | // If this is true from the first call then Airmech will assume the Health-and-Safety warning |
| 296 | // is still being displayed. |
| 297 | static bool first_call = true; |
| 298 | sessionStatus->IsVisible = vr::VRCompositor()->CanRenderScene() && !first_call; |
| 299 | first_call = false; |
| 300 | |
| 301 | static const bool do_sleep = session->UseHack(HACK_SLEEP_IN_SESSION_STATUS); |
| 302 | if (do_sleep) |
| 303 | std::this_thread::sleep_for(std::chrono::milliseconds(1)); |
| 304 | |
| 305 | return ovrSuccess; |
| 306 | } |
| 307 | |
| 308 | OVR_PUBLIC_FUNCTION(ovrResult) ovr_SetTrackingOriginType(ovrSession session, ovrTrackingOrigin origin) |
| 309 | { |
nothing calls this directly
no test coverage detected