Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
ctrlaltdavid's avatar
ctrlaltdavid
Honored Guest
11 years ago

How to exit direct mode?

I've managed to get direct mode working with OpenGL on Windows using the SDK / C++. But how can you exit direct mode back to normal mono display in the application?

The application I'm working on starts up in mono display and the user can toggle in and out of VR display mode at will. This works well with the Rift configured to use extended mode, but with direct mode there seems to be no way to do the opposite of ovr_attachToWindow(). For example, doing ovrHmd_Destroy() and ovr_Shutdown() just leaves the application window a solid black.

6 Replies

  • My engine allows toggling HMD on/off and I would also like for there to be a detatch window method when run in direct mode.
  • owenwp's avatar
    owenwp
    Expert Protege
    Why are you trying to do this? Does it matter if the Oculus SDK is still active? If it is just a matter of showing an image on the Rift, there is a device caps bit flag for disabling the Rift's screen while in direct mode.

    Otherwise you will need to shutdown and re-initialize the graphics API.
  • Nobody said that deactivating the Oculus SDK was the goal - the goal is to detatch the window from the HMD and have it back to as it was before attaching it. OP was trying to deactivate the SDK as a means to detatch the window, but it didn't work. If you can attach a window, you should be able to detatch it also.
  • owenwp's avatar
    owenwp
    Expert Protege
    But again, for what purpose? It should never be necessary. If you want to stop rendering in stereo, stop rendering in stereo. If you want to go fullscreen, go fullscreen. There should not be anything stopping you.
  • "ctrlaltdavid" wrote:
    I've managed to get direct mode working with OpenGL on Windows using the SDK / C++.


    I've been struggling with this for quite some time; what was it you did to get it to work?
  • "JeffBail" wrote:
    "ctrlaltdavid" wrote:
    I've managed to get direct mode working with OpenGL on Windows using the SDK / C++.


    I've been struggling with this for quite some time; what was it you did to get it to work?


    I've found a lot of problems stem from the fact that Direct Mode won't engage unless you're calling the ovrHmd_GetEyePoses() method on each frame. Clearly, it shouldn't be a requirement, and you don't have to actually use the values you get back during rendering, but if I'm not calling that in your rendering loop, Direct Mode never activates.