| None. |
|
Prepares a connected PC VR headset, before you open graphics. Call it before Graphics3D. It finds the headset through the PC's OpenXR runtime and checks that it can show your program in stereo. It returns True when everything is ready, but nothing appears in the headset yet: after Graphics3D, attach a camera with EnableVR. prepared=InitVR() Graphics3D 960,640,32,2 camera=CreateCamera() CameraRange camera,0.05,100 PositionEntity camera,0,1.6,0 If prepared Then EnableVR camera,1.0 If there is no headset, or the runtime refuses, InitVR returns False and VRLastError says why. Keep that message for your players and carry on with the ordinary desktop view - the same program then works with or without a headset. Calling it once graphics are open fails: call EndGraphics, then InitVR, then Graphics3D again. Calling it again after it has succeeded is harmless. If your program forces a different graphics adapter, or the WARP software renderer, VR is abandoned and the desktop keeps the adapter you asked for. 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: EnableVR, VRLastError, ShutdownVR, VRState, Graphics3D. |