Forum Discussion
philigaultier
12 years agoHonored Guest
What can cause ovrHmd_CreateDebug to fail
Hi,
I've written some programs with the Oculus Rift SDK 0.3.2 and everything worked fine.
I ran them with both a 'real' Oculus and the 'false' one, aka created with
But here I've come to an unexpected issue: the following code throws the exception:
The code for ovrHmd_CreateDebug is quite simple (located in CAPI_HmdState.cpp):
So I suppose
Until now I did not bother with any GlobalState::pInstance...
Maybe someone knows the cause of the problem or experienced it before?
Thanks for your help
I've written some programs with the Oculus Rift SDK 0.3.2 and everything worked fine.
I ran them with both a 'real' Oculus and the 'false' one, aka created with
ovrHmd_CreateDebug(ovrHmd_DK1)
But here I've come to an unexpected issue: the following code throws the exception:
hmd_ = ovrHmd_Create(0);
if (!hmd_)
{
hmd_ = ovrHmd_CreateDebug(ovrHmd_DK1);
if(!hmd_)
{
throw std::runtime_error("Cannot create the debug dk1");
}
}
The code for ovrHmd_CreateDebug is quite simple (located in CAPI_HmdState.cpp):
OVR_EXPORT ovrHmd ovrHmd_CreateDebug(ovrHmdType type)
{
if (!GlobalState::pInstance)
return 0;
HMDState* hmds = new HMDState(type);
return hmds;
}
So I suppose
GlobalState::pInstanceis null, but how? why?
Until now I did not bother with any GlobalState::pInstance...
Maybe someone knows the cause of the problem or experienced it before?
Thanks for your help
2 Replies
- jhericoAdventurerYou still have to call ovr_Initialize before you call any other functions. If GlobalState::pInstance is null, you have not called it (or you've called ovr_Shutdown at some point).
- philigaultierHonored GuestThank you, that was it. Dumb mistake.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 4 years ago