Closed ChrisDenham closed 8 years ago
Well, this is probably the way to do it in pre 0.8.0.0.
But now I guess we should use the ovr_Detect
function before even trying to initialize a OculusDevice object.
And then there is the ovr_GetSessionStatus
function that could be used.
And you can still use a debug device. But it is not possible to initialize it from code. Instead you have to use the Oculus Configuration Utility and go to the Tools -> Service -> Configure...
menu. In this dialog you can choose you desired debug HMD type.
Ah, thanks, didn't know about the debug HUD config. Do you want me to change this pull request to use ovr_Detect? If ovr_Detect returned true but the ovr_Initialize or ovr_Create failed the viewer would still crash, so in a way, it seems safer the way I have done it?
By using ovr_Detect
we could spawn a standard osg viewer instead if no HMD or Debug-HMD are "connected". Your solution may still be valid. But should probably be modified to use the ovr_GetSessionStatus
in the hmdDetected()
function, instead of returning a value which only is set during initialization. By consequence the function should probably have a different name and possibly even a different return type.
I actually started working on a similar solution yesterday, but was unable to finish due to other work with higher priority.
OK, I'll wait for your fix. Closing this for now. Thanks.
Fixed in #76
Since the 0.7.0.0 SDK no longer seems to support creating the debug emulated HMD when no device is present or detected, the viewer crashes because it proceeds without a valid device handle.
This change just allows the viewer to exit more cleanly when no HMD is plugged in.