Working with ScriptDragon to try and attempt to put some HTC vive functionality in to Skyrim using OpenVR.
What I have working. Able to initialize the Headset, as in no errors return and the pointer to the headset object is not null, and the vive light turns from red to green when I go in to the game.
Working
void InitHMD(vr::IVRSystem* hmd)
{
vr::EVRInitError eError = vr::VRInitError_None;
hmd = vr::VR_Init(&eError, vr::VRApplication_Other);
if (eError != vr::VRInitError_None)
{
PrintNote("Error: %s", eError);
}
else
{
PrintNote("HMD succesfully initialized");
}
//extra chech for my own sanity
if (hmd == nullptr)
{
PrintNote("NULL POINTER HMD");
}
else
{
PrintNote("HMD pointer set");
}
}
Running the game text props show that the HMD pointer is set and it was successfully initialized. Full source available here. When ever the home Key is pressed it calls the hmd member function and suddenly breaks.
Not Working After Init
bool temp = hmd->IsInputFocusCapturedByAnotherProcess();
What doesn't work is that as soon as I try to access any of the member functions it crashes the game leading me to believe I have not initialized the headset fully or there is a problem with memory allocation.
I have the linker properties and includes set up and all external files where they should be.
ScriptDragon shouldn't be the problem as someone else has done something similar with the razer hydra and in their source, is able to call member functions within there api.