Forum Discussion

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

SDK 0.4.0, DK1, direct to HMD and ovrHmd_AttachToWindow

Still using the DK1, I have updated my previous integration (0.2.5c) to the new 0.4.0 SDK, and everything is working fine using the extended desktop mode. However, I am having issues getting the direct to HMD rendering working in my application. Specifically, after calling ovrHmd_AttachToWindow (no error return value) I see no output going to the HMD, and my window continues to render the post-disortion eye views. I have, on one occasion, seen a bit of my VStudio window show up in a funky interlaced view in the HMD, but generally it just remains black.

I am doing client-side mesh distortion rendering (not using SDK rendering), in my own custom DX11-based engine.

It's worth noting that both the RoomTiny and WorldDemo sample do run fine in both extended desktop and direct-to-HMD modes. So clearly I am doing something divergent that is causing the issue.

I have taken care to duplicate the same initialization order as the tiny room demo, have verified I'm passing in the correct HWND handle, and have stepped through ovrHmd_AttachToWindow, although that seems to simply save the window handle off for later use.

Other differences that came to mind included my multithreading setup. Since my rendering is in a different thread than the one I create the HMD on, I tried postponing calling ovrHmdAttachToWindow until I was in my render thread, but that had no apparent effect. My actual window (and associated message pump) is created in yet another thread, but doing any initialization in that thread would be non-trivial.

So, generally speaking, are there any threading gotchas with initialization? Any requirements insofar as what thread you call ovrHmd_AttachToWindow in? Or just generally any thoughts on what might be going wrong (read: what *I'm* doing wrong)?

Other semi-pertinent info about my setup:
Visual Studio 2010 (Windows 8.1 SDK)
Windows 7 Professional 64-bit
Geforce 560Ti (332.21 drivers), single monitor

16 Replies