MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / VR_IsHmdPresent

Function VR_IsHmdPresent

src/openvr_api_public.cpp:200–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200bool VR_IsHmdPresent()
201{
202 std::lock_guard<std::recursive_mutex> lock( g_mutexSystem );
203
204 if( g_pHmdSystem )
205 {
206 // if we're already initialized, just call through
207 return g_pHmdSystem->BIsHmdPresent();
208 }
209 else
210 {
211 // otherwise we need to do a bit more work
212 EVRInitError err = VR_LoadHmdSystemInternal();
213 if( err != VRInitError_None )
214 return false;
215
216 bool bHasHmd = g_pHmdSystem->BIsHmdPresent();
217
218 g_pHmdSystem = NULL;
219 SharedLib_Unload( g_pVRModule );
220 g_pVRModule = NULL;
221
222 return bHasHmd;
223 }
224}
225
226/** Returns true if the OpenVR runtime is installed. */
227bool VR_IsRuntimeInstalled()

Callers

nothing calls this directly

Calls 2

VR_LoadHmdSystemInternalFunction · 0.85
SharedLib_UnloadFunction · 0.85

Tested by

no test coverage detected