Forum Discussion

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

ovrHmd_AttachToWindow?

Hi,

can anyone give me a hint on how to get the ovrHmd_AttachToWindow working with client side rendering?

Right now I tried this:
Init my OpenGL window (in fact it is a QGLWidget since our application is Qt-based). Then I initalize the oculus and the HMD. After that I grap the native windows handle of its parent window:
HWND handle = (HWND)parentWidget->winId();
Then I call ovrHmd_AttachToWindow( hmd, static_cast<void*>(handle), nullptr, nullptr);

The call returns true but my oculus display just stays black. Is there anything else I need to do? Resize the Window to a specific size?

Kind regards
Michael

5 Replies

  • "MichaelNikelsky" wrote:
    Hi,

    can anyone give me a hint on how to get the ovrHmd_AttachToWindow working with client side rendering?

    Right now I tried this:
    Init my OpenGL window (in fact it is a QGLWidget since our application is Qt-based). Then I initalize the oculus and the HMD. After that I grap the native windows handle of its parent window:
    HWND handle = (HWND)parentWidget->winId();
    Then I call ovrHmd_AttachToWindow( hmd, static_cast<void*>(handle), nullptr, nullptr);

    The call returns true but my oculus display just stays black. Is there anything else I need to do? Resize the Window to a specific size?

    Kind regards
    Michael


    Can you try this order:

    ovr_Initialize
    ovrHmd_Create
    QT based window creation & OpenGL context creation
    ovrHmd_AttachToWindow
    ovrHmd_ConfigureRendering ( in case of direct HMD mode )
  • mrjazz's avatar
    mrjazz
    Honored Guest
    "renderingpipeline" wrote:
    (...), even as an extended desktop I didn't get usable results yet (lots of stuttering so far).

    The problem seems to be the vsync being taken from the primary display and not from the Rift-display. I'm currently investigating how to fix this.
  • "mrjazz" wrote:

    The problem seems to be the vsync being taken from the primary display and not from the Rift-display. I'm currently investigating how to fix this.


    Set the Rift as the primary screen works for me (also: only use the Rift).