Skip to main content
Up and Coming
September 12, 2014

Status of openGL direct-to-HMD as of 0.4.2

I got my application working in client-rendered, extended desktop mode, using openGL on Mac.

When trying on Windows, it works okay so far, but I can't seem to enable direct-To-Rift mode.
I call ovrHmd_AttachToWindow() with no visible effect, the distorted render output stays on the main display where it was, and the Rift stays dark.
I run Windows 7, an AMD HD8970 with Catalyst 14.4 and oculus runtime 0.4.2.

I read that openGL and Direct-to-HMD is not working anyway, much less on AMD, but I would like to confirm that ovrHMD_AttachToWindow() just doing NOTHING is what is expected to happen as of now, as I've read several forum threads where it fails differently, but they might be older than 0.4.2.

    48 replies

    Inspiring
    October 27, 2014
    "tmason101" wrote:

    Do you happen to be using GLFW? My app crashes now when I use GLFW with the Oculus Rift but works fine when the Rift isn't turned on.


    I'm using GLFW for all my examples. Works fine.
    Brad Davis - Developer for High Fidelity Co-author of Oculus Rift in Action
    Up and Coming
    October 28, 2014
    "jherico" wrote:
    "tmason101" wrote:

    Do you happen to be using GLFW? My app crashes now when I use GLFW with the Oculus Rift but works fine when the Rift isn't turned on.


    I'm using GLFW for all my examples. Works fine.


    Thanks; within the SDK 0.4.3 I presume?

    I'll check out your examples. For some reason when I start up GLFW via glfwCreateWindow() it crashes.
    Up and Coming
    October 28, 2014
    Getting a little further..

    I'm using client distortion rendering (not SDK) with Qt 5.3 handling window/context creation.

    I managed to stop the crashing - it seems if you have any glErrors sat in the queue a call to SwapBuffers will kill the app without any warning/backtrace (maybe there's a stray assert somewhere?)

    I can reliably kill things by sticking this in front of the swapBuffers call in order to generate a GL_INVALID_ENUM.


    GLboolean fake = false;
    glGetBooleanv(012345, &fake);


    If anyone else can confirm this I'll start a topic in the issues forum. You can fix it just by clearing the error queue before SwapBuffers so not the end of the world.

    Tracked this down by setting OVRShouldEnableDebug() in OVR_Win32_ShimFunctions.cpp to return TRUE (gives a LOT of debug output, the last part before the crash was a glGetError() dump)

    Having fixed my code so I'm not leaving any naughty errors skulking around, I get a blue light, but both the on screen window and the rift are blank. I also get


    DXGI WARNING: IDXGIFactory::CreateSwapChain: DXGI_SWAP_CHAIN_DESC.OutputWindow is not a valid window handle. [ MISCELLANEOUS WARNING #65: ]


    Additionally updates are really slow (3 second frames)

    Thought it might be that I was passing in the wrong handle, but I can use GDI calls to move the window around using the handle I'm passing in, so don't think that can be it.

    Only other red flag is that there are a bunch of (handled) exceptions coming from d3d11!NDXGI::CResource::GetSharedHandle when I do context creation.

    Ah well, will keep poking around. I'm probably doing something stupid as I'm pretty much a linux programmer flailing around in windows..
    Up and Coming
    October 28, 2014
    Just checking, but you're not passing the handle of the top-level Qt window I hope. You should pass the handle of the Qt OpenGL widget.
    John Tsiombikas webpage - blog - youtube channel
    Up and Coming
    October 29, 2014
    I'm rendering directly to a QWindow with an OpenGL surface rather than a QGLWidget or the new QOpenGLWidget, so the top level window handle is the only game in town.

    Just tried hacking in SDK rendering into my project and that works fine* in direct mode using the same mechanism for getting the window handle - so i think I can rule out that being the issue.

    So.. has anyone got an OpenGL, client distortion rendered project working in direct mode?

    *The performance is fairly poor but it renders everything OK.
    Up and Coming
    March 31, 2015
    I'm happy to report that with OVR SDK 0.5.0.1 direct mode is working for me! Thanks very much to the Oculus team for getting this working!

    I initially had a lot of flicker on my monitor (although everything was fine inside the Rift) but that was fixed by updating to NVIDIA 347.88.
    Up and Coming
    April 19, 2015
    "JeffBail" wrote:
    I'm happy to report that with OVR SDK 0.5.0.1 direct mode is working for me! Thanks very much to the Oculus team for getting this working!

    I initially had a lot of flicker on my monitor (although everything was fine inside the Rift) but that was fixed by updating to NVIDIA 347.88.


    Hi, can you post some short example code?