OpenTk example

May 19, 2015 at 8:28 AM
hi! thanks for this great project!
I 'm trying to make it work with openTK. I'm facing one issue: how can i get the device context from a gamewindow or a glControl?

Or is there any available simple example with opentk ?

May 19, 2015 at 12:58 PM
I managed to display my random textures on the first screen, but there is nothing displayed on the oculus.
screenshot :
May 20, 2015 at 2:55 PM
Hi Michael_Traore,

Unfortunately I haven't gotten any experience with with OpenTK, so I won't be able to give any advice on how it's used with OculusWrap.

My suggestion would be to try asking the same question on the Oculus forums, where other C++ developers may have more experience with using OpenGL together with the Oculus SDK. Even though C++, OpenGL and Oculus SDK are a bit different than C#, OpenTK and OculusWrap, I think that the differences should be small enough to allow you to still use that information together with OculusWrap.

When using DirectX 11, I did however experience a problem which sounds similar to what you experience in OpenGL (Or rather OpenTK). My problem was that even though a distorted result was shown in a window on the monitor, the Rift would not turn on. I finally managed to figure out that the problem was caused by the window handle, which I passed on to the Oculus SDK, was the window handle of a child window and not the window handle of a top level window. As soon as I rendered directly into the top level window and passed the handle of that top level window, to the rift, the HMD came on and displayed the result.

Another known DirectX 11 issue, that caused an identical problem, was that if any DirectX objects were created, before calling the Wrap.Initialize method (Or the ovr_Initialize method on the Oculus SDK), then the Oculus SDK would not be able to intercept the DirectX call and the HMD would not turn on.

I have no idea if these two last suggestions also apply to OpenTK as well, but I guess it's worth a try.
Marked as answer by MortInfinite on 6/12/2015 at 11:22 PM