GetEnabledCaps always returns None

Feb 1, 2015 at 10:28 PM
Hi, fantastic work on the wrapper!

I'm trying to get an OpenGL example working, but for some reason whenever I call GetEnabledCaps() its returning nothing.

This happens if I call GetEnabledCaps() on the instance of Hmd, or if I call it directly via:

OVR.HmdCaps caps = OVR.ovrHmd_GetEnabledCaps(hmdPtr);

Is there some initialisation problem I'm hitting here? This is to honour the user setting of Extended Desktop mode or Direct mode.
Feb 1, 2015 at 10:43 PM
Edited Feb 1, 2015 at 10:51 PM
Oh let me amend this by saying that I'm doing this:
OVR.HmdCaps caps = hmd.GetEnabledCaps();
if (caps.HasFlag(OVR.HmdCaps.ExtendDesktop)) {
  Console.WriteLine("ExtendedDeskop mode!");
} else {
  Console.WriteLine("Direct mode!");
}
I can see via the debugger that the hmd instance has an HmdCaps value of 4745 so it's definitely there. Am I not accessing it the right way?

EDIT:

If I change the code to check hmd.HmdCaps.HasFlag(OVR.HmdCaps.ExtendDesktop) it works.
Coordinator
Feb 2, 2015 at 3:06 PM
As far as I can tell, by running the unit test, the Hmd.GetEnabledCaps is working correctly.

When calling Hmd.SetEnabledCaps, please be aware that only caps that match the Writable_OVR.HmdCaps.Writable_Mask can be set, while those caps that do not match this mask, are ignored.

The mask consists of the following settable flags:
DisplayOff
LowPersistence
DynamicPrediction
NoVSync
NoMirrorToWindow

Because the ExtendDesktop flag isn't part of the Writeable_Mask bits, the setting is ignored by the Oculus SDK.

The value of the Hmd.HmdCaps has a different meaning than the value retrieved by calling Hmd.GetEnabledCaps.
The Hmd.HmdCaps property describes all features available on the HMD, while the Hmd.GetEnabledCaps describes which features are currently enabled.


The method comment on the Hmd.GetEnabledCaps method (Copied from the Oculus SDK's ovrHmd_GetEnabledCaps method), describes the difference as follows:
Returns capability bits that are enabled at this time as described by ovrHmdCaps.
Note that this value is different font ovrHmdDesc::HmdCaps, which describes what
capabilities are available for that HMD.
Marked as answer by MortInfinite on 3/21/2015 at 11:52 PM
Feb 2, 2015 at 7:09 PM
Edited Feb 2, 2015 at 7:12 PM
Ah gotcha, yes so GetEnabledCaps() is really only for runtime configuration options which you can also set with SetEnabledCaps(). If you're looking at the configuration options from the way in which the Rift is set up, then you use something different. Makes sense now you describe it that way!