Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
whitehexagon's avatar
whitehexagon
Explorer
10 years ago

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

  • 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 :)
  • 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.
  • 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.
  • 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?
  • 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.