Skip to main content
Up and Coming
June 2, 2015

OpenGL mirror window optional?

I'm just wondering if the 'mirror' desktop window is optional? Assuming it is, then is it possible to run a rift app without GLFW?

    7 replies

    Up and Coming
    June 2, 2015
    In my current integration with 0.6.0.0 I'm not mirroring at all and I'm still getting Rift output. Unfortunately I'm having some trouble with my OpenSceneGraph / OpenGL application that's causing some flicker (see https://forums.oculus.com/viewtopic.php?f=39&t=1885&start=20#p275795) but I can tell you for sure you can get textures onto the Rift without calling ovrHmd_CreateMirrorTextureGL.
    Up and Coming
    June 2, 2015
    Interesting! thanks for that info. Do you know at what point the Rift activates? I see the camera light turn on, but the Rift stays orange even after submitFrame.

    I was thinking to remove the GLFW stuff just to see if it made a difference. Good to know it can work like that, thanks. Peter.

    PS I also get error 1286 invalid framebuffer errors, seems to be after my glClear(color | depth) call, but maybe only every other frame. I'm still trying to track that one down :)
    DK2, MBP (mid 2010) OSX 10.10.3. Win7 - i5 4670K - GTX770. Java LWJGL 3 OpenGL Experiments: https://github.com/WhiteHexagon
    Up and Coming
    June 2, 2015
    I remember some other threads which seemed to indicate that you need to call ovrHmd_GetEyePoses to get it to render properly but I can't vouch for that because I've always called it. For me the camera lights up first and the the Rift follows less then a second later.
    Up and Coming
    June 2, 2015
    Hmm, turns out I needed a reboot! Rift lights up now :)

    I also found the issue with the FBOs. I was switching FBO based on eye no. rather than the currentIndex.
    DK2, MBP (mid 2010) OSX 10.10.3. Win7 - i5 4670K - GTX770. Java LWJGL 3 OpenGL Experiments: https://github.com/WhiteHexagon
    Up and Coming
    June 4, 2015
    Well it seems that I can almost remove GLFW, but not quite. Since the OpenGL context the Rift uses does not seem to be exposed? So I'm having to create a window just so I can have my own context. Does that sound right?
    DK2, MBP (mid 2010) OSX 10.10.3. Win7 - i5 4670K - GTX770. Java LWJGL 3 OpenGL Experiments: https://github.com/WhiteHexagon
    Up and Coming
    June 4, 2015
    You're shouldn't be trying to use any context that the SDK creates, everything is supposed to be encapsulated. If you don't want to create a window with GLFW, you can try creating your own context without a window with wglCreateContext() and using GetDC() with NULL (so it gets the device context of the entire screen rather than a specific window) but I've never tried that so am not sure if that would work.

    Personally I would advise against it though, as not having a window would mean that the application won't appear on the taskbar. If a user left a game running then came back later, they wouldn't have any sort of indicator showing that it is still running. If I'm not mirroring the Rift's display, I just show a message on that window telling the user to please look in to the Rift.
    Up and Coming
    June 4, 2015
    Thanks for the good advice. I'm going to do just that :)
    DK2, MBP (mid 2010) OSX 10.10.3. Win7 - i5 4670K - GTX770. Java LWJGL 3 OpenGL Experiments: https://github.com/WhiteHexagon