A minimal test of displaying something with OpenVR
Depends on:
- Quick Diagnostic
- Checks if it can detect an HMD
- Checks if the runtime is installed
- Intialise OpenVR
- Setup the companion window
- Initialise OpenGL context + some scene data
- Create frame buffer objects
- We need two frame buffers for each eye (4 in total).
- The first is the one you're application will actually use and has the associated image, depth, stencil etc. components
- After rendering is done we blit the result to a 'resolve' buffer, that contains an image component only and send that to the HMD
- Initialse the Compositor
- Run the main loop
UpdateHMDMatrrixPose()
- This gets the current HMD position using the functionvr::VRCompositor()->WaitGetPoses()
-WaitGetPoses()
must be called otherwise the app will be considered unresponsive and nothing will be dislpayed on the HMD- Render scene for left and right eyes
- Send frame buffers to the HMD
- Send frame buffers to the companion window