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 7fc746fce0
commit f1dd6b8db9
5 changed files with 11 additions and 1 deletions

View file

@ -77,6 +77,7 @@ public:
std::string Manufacturer; std::string Manufacturer;
std::string ProductName; std::string ProductName;
std::string Serial; // A unique device identifier 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.Manufacturer = "NeL";
devInfo.ProductName = "Stereo Debugger"; devInfo.ProductName = "Stereo Debugger";
devInfo.Serial = "NL-3D-DEBUG"; devInfo.Serial = "NL-3D-DEBUG";
devInfo.AllowAuto = false;
devicesOut.push_back(devInfo); devicesOut.push_back(devInfo);
} }

View file

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

View file

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

View file

@ -93,9 +93,15 @@ void initCamera()
std::string hmdDeviceCfg = ConfigFile->getVar("HMDDevice").asString(); std::string hmdDeviceCfg = ConfigFile->getVar("HMDDevice").asString();
if (hmdDeviceCfg == std::string("Auto") if (hmdDeviceCfg == std::string("Auto")
&& devices.begin() != devices.end()) && devices.begin() != devices.end())
{
for (std::vector<NL3D::CStereoDeviceInfo>::iterator it(devices.begin()), end(devices.end()); it != end; ++it)
{
if (it->AllowAuto)
{ {
deviceInfo = &devices[0]; deviceInfo = &devices[0];
} }
}
}
else else
{ {
std::string hmdDeviceId = ConfigFile->getVar("HMDDeviceId").asString(); std::string hmdDeviceId = ConfigFile->getVar("HMDDeviceId").asString();