Forum Discussion

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

Trouble creating a HMD device from a device added message

Using the Mac OS X version of the 0.2.5 SDK.

I'm trying to implement the message adding/removing to correctly handle both cases, but I can't seem to handle the Message_DeviceAdded when the handle type is Device_HMD correctly. If I try creating an HMDDevice when I receive this message using either:
Msg.Handle.CreateDeviceTyped<HMDDevice>();
//or
Manager->EnumerateDevices<HMDDevice>().CreateDevice();


After the device is created (or I obtain a reference to it), when I proceed to create a sensor device through GetSensor it ends up locking in that function, regardless of whether the USB is connected or not. Creating an HMDDevice normally if it's connected at the programs startup it handles both cases correctly so I assumed it would be the same for when performing it later.

I then thought I'd try creating the HMDDevice outside of the message callback method. When I try this it just locks up on CreateDevice.

So was wondering what's the correct way I should go about handling this?

1 Reply

  • Are you attempting the creation in another thread? The OnMessage() callback is called from the SDK device manager threads. Device creation should be called from a different thread.