Forum Discussion
mmostajab
10 years agoHonored Guest
ovrHmd_AttachToWindow is not working in Qt's GLWidget.
I wanted to send the output directly to the oculus using the ovrHmd_AttachToWindow function as follows: if (!ovrHmd_AttachToWindow(hmd, (void*) Base::winId(), 0, 0)) { dprintf...
jherico
10 years agoAdventurer
"mmostajab" wrote:
I wanted to send the output directly to the oculus using the ovrHmd_AttachToWindow function as follows:if (!ovrHmd_AttachToWindow(hmd, (void*) Base::winId(), 0, 0)) {
dprintf("HMD: Could not attach to window!\n");
return;
}
dprintf("HMD: connected to window with id HWND=%i", Base::winId());
unfortunately, it is not working. Also, there is no error. Just it is not sent directly to the Oculus. The window is appearing there, and I should move the windows to oculus manually and make it full screen. I am using the extended display mode.
You seem to be misunderstanding how the Direct/Extended mechanism works from an application perspective. Your expectations appear to be based on how Direct mode works, but you're working in Extended. You can detect if the HMD is in Direct mode by checking the flags, and it's your responsibility as a developer to do the right thing depending on what mode you detect.
Specifically, if you're in extended mode, it's your responsibility to create a fullscreen window on the target monitor (which can be found by looking in the ovrHmd structure) or create a borderless window matching the desktop position and current resolution of the Rift. In extended mode, ovrHmd_AttachToWindow doesn't actually have any effect.
In Direct mode, on the other hand, the ovrHmd_AttachToWindow is what tells the SDK to link the OpenGL context for the window to the actual display on the Rift.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 5 years ago
- 9 years ago
- 1 year ago