VRLastError$ ( )

Parameters

None.

Description

Returns why the last VR command failed, or "" if nothing has gone wrong.

Every VR command that can fail clears it when it starts, and the queries leave it alone. So read it straight after a failure, before you call another VR command - for example, keep InitVR's message to show players who start your game without a headset:

If InitVR()=False Then vr_problem$=VRLastError()

Failures that happen later, such as a headset being unplugged, also appear here, and in the diagnostics log.

Automatic VR is experimental, and works in 64-bit Windows programs through an OpenXR runtime and Direct3D 12. In 32-bit programs the commands are there, so the same source compiles, but InitVR returns False and VRLastError says why.

For the full story - setup, frame rules and limitations - see the Automatic PC VR guide and its complete AutomaticVR.bb sample.


See also: InitVR, EnableVR, VRState.

Index