cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting disconnected cables

hmiller
Honored Guest
What's the best way to detect disconnected cables on the 1.0 SDK? I'm trying to use ovr_GetSessionStatus(), but I get mixed results with that. Disconnecting the USB sets HmdPresent and HmdMounted to false, but disconnecting the HDMI sets DisplayLost. Disconnecting the power cable also sets the DisplayLost, but ovr_Detect() still returns IsOculusHMDConnected.
1 REPLY 1

simon_green
Honored Guest
It depends what your goal is?

ovr_GetSessionStatus == HmdPresent is the correct way to check if the HMD is present and working.

DisplayLost means you need to re-create the texture swap-chain.

ovr_Detect is designed to check if the HMD is available without initializing LibOVR, for games with VR and non-VR modes.


From your mention of the power cable, I guess you're working on a DK2? I'm not sure the behaviour is exactly the same as on the consumer Rift.

I would check the OculusWorldDemo source for the best practice.