Do not select stereo display debugger when HMD is set to Auto in Snowballs

This commit is contained in:
kaetemi 2014-02-04 20:52:15 +01:00
parent 2833cc42d4
commit 7989e9e6bc
5 changed files with 11 additions and 1 deletions

View file

@ -77,6 +77,7 @@ public:
std::string Manufacturer;
std::string ProductName;
std::string Serial; // A unique device identifier
bool AllowAuto; // Allow this device to be automatically selected when no device is configured
};
/**

View file

@ -453,6 +453,7 @@ void CStereoDebugger::listDevices(std::vector<CStereoDeviceInfo> &devicesOut)
devInfo.Manufacturer = "NeL";
devInfo.ProductName = "Stereo Debugger";
devInfo.Serial = "NL-3D-DEBUG";
devInfo.AllowAuto = false;
devicesOut.push_back(devInfo);
}

View file

@ -612,6 +612,7 @@ void CStereoLibVR::listDevices(std::vector<CStereoDeviceInfo> &devicesOut)
deviceInfoOut.Factory = static_cast<IStereoDeviceFactory *>(handle);
deviceInfoOut.Class = CStereoDeviceInfo::StereoHMD;
deviceInfoOut.Library = CStereoDeviceInfo::LibVR;
deviceInfoOut.AllowAuto = true;
//TODO: manufacturer, produc name
//TODO: serial
devicesOut.push_back(deviceInfoOut);

View file

@ -816,6 +816,7 @@ void CStereoOVR::listDevices(std::vector<CStereoDeviceInfo> &devicesOut)
deviceInfoOut.Library = CStereoDeviceInfo::OVR; // "Oculus SDK";
deviceInfoOut.Manufacturer = deviceInfo.Manufacturer;
deviceInfoOut.ProductName = deviceInfo.ProductName;
deviceInfoOut.AllowAuto = true;
stringstream ser;
ser << id;
deviceInfoOut.Serial = ser.str(); // can't get the real serial from the sdk...

View file

@ -94,7 +94,13 @@ void initCamera()
if (hmdDeviceCfg == std::string("Auto")
&& devices.begin() != devices.end())
{
deviceInfo = &devices[0];
for (std::vector<NL3D::CStereoDeviceInfo>::iterator it(devices.begin()), end(devices.end()); it != end; ++it)
{
if (it->AllowAuto)
{
deviceInfo = &devices[0];
}
}
}
else
{