C++ check is game in HMD (VR) mode

anonymous_user_e10a6464
Wed, 02 May 2018 04:30:13 +0000
XR Development

How do I check, in C++ code, whether the game is in VR mode?

I tried the following but it doesn’t work:

IHeadMountedDisplay *pHmd = nullptr;
if (GEngine) {
	pHmd = GEngine->XRSystem->GetHMDDevice();
}
if (pHmd->IsHMDEnabled()) {
	// we are in VR mode?
}

The above code thinks we’re in VR even when we are not.

4 posts - 3 participants