OpenGL working with Direct HMD mode
Currently OpenGL isn't supported in Direct HMD mode with the Oculus SDK. Unfortunately this causes serious issues since unless you set the Rift as your primary monitor, you will end up having some form of v-sync and/or judder issues. Direct3D doesn't seem to have these problems when running in Direct HMD mode. OpenGL also currently doesn't support some of the functionality that's available in Direct3D, such as Overdrive.
To solve these problems I've created a demo showing how you can use Direct3D to interact with the Oculus SDK, but still use OpenGL for your rendering. The linked code is an updated version of this demo which has been stripped down to the bare minimum. It uses GLFW for OpenGL window creation and management. It actually creates two windows, one for an OpenGL context, and the other for a Direct3D context. The Direct3D window is kept hidden behind the GLFW window at all times through a little bit of Win32 trickery.
I'm considering creating a custom version of the Oculus SDK that will automatically use this technique if OpenGL is selected as the rendering API, direct HMD mode is active, and the extensions are supported on the system.
To solve these problems I've created a demo showing how you can use Direct3D to interact with the Oculus SDK, but still use OpenGL for your rendering. The linked code is an updated version of this demo which has been stripped down to the bare minimum. It uses GLFW for OpenGL window creation and management. It actually creates two windows, one for an OpenGL context, and the other for a Direct3D context. The Direct3D window is kept hidden behind the GLFW window at all times through a little bit of Win32 trickery.
I'm considering creating a custom version of the Oculus SDK that will automatically use this technique if OpenGL is selected as the rendering API, direct HMD mode is active, and the extensions are supported on the system.
