Add library name to device name, re #43

This commit is contained in:
kaetemi 2013-06-26 02:55:15 +02:00
parent b45bdb88e6
commit dc813a060e
3 changed files with 4 additions and 2 deletions

View file

@ -61,6 +61,7 @@ public:
uint8 Identifier; uint8 Identifier;
NLMISC::CSmartPtr<NLMISC::CRefCount> Factory; NLMISC::CSmartPtr<NLMISC::CRefCount> Factory;
std::string Library;
std::string Manufacturer; std::string Manufacturer;
std::string ProductName; std::string ProductName;
}; };

View file

@ -177,6 +177,7 @@ void CStereoOVR::listDevices(std::vector<CStereoDeviceInfo> &devicesOut)
deviceInfoOut.Factory = static_cast<NLMISC::CRefCount *>(handle); deviceInfoOut.Factory = static_cast<NLMISC::CRefCount *>(handle);
handle->DeviceHandle = devices; handle->DeviceHandle = devices;
deviceInfoOut.Class = 1; // OVR::HMDDevice deviceInfoOut.Class = 1; // OVR::HMDDevice
deviceInfoOut.Library = "Oculus SDK";
deviceInfoOut.Identifier = id; deviceInfoOut.Identifier = id;
deviceInfoOut.Manufacturer = deviceInfo.Manufacturer; deviceInfoOut.Manufacturer = deviceInfo.Manufacturer;
deviceInfoOut.ProductName = deviceInfo.ProductName; deviceInfoOut.ProductName = deviceInfo.ProductName;

View file

@ -85,7 +85,7 @@ void initCamera()
for (std::vector<NL3D::CStereoDeviceInfo>::iterator it(devices.begin()), end(devices.end()); it != end; ++it) for (std::vector<NL3D::CStereoDeviceInfo>::iterator it(devices.begin()), end(devices.end()); it != end; ++it)
{ {
std::stringstream name; std::stringstream name;
name << std::string("[") << (uint32)it->Identifier << "] [" << it->Manufacturer << " - " << it->ProductName << "]"; name << std::string("[") << (uint32)it->Identifier << "] [" << it->Library << " - " << it->Manufacturer << " - " << it->ProductName << "]";
nlinfo("Stereo Device: %s", name.str().c_str()); nlinfo("Stereo Device: %s", name.str().c_str());
} }
CStereoDeviceInfo *deviceInfo = NULL; CStereoDeviceInfo *deviceInfo = NULL;
@ -101,7 +101,7 @@ void initCamera()
for (std::vector<NL3D::CStereoDeviceInfo>::iterator it(devices.begin()), end(devices.end()); it != end; ++it) for (std::vector<NL3D::CStereoDeviceInfo>::iterator it(devices.begin()), end(devices.end()); it != end; ++it)
{ {
std::stringstream name; std::stringstream name;
name << it->Manufacturer << " - " << it->ProductName; name << it->Library << " - " << it->Manufacturer << " - " << it->ProductName;
if (name.str() == hmdDeviceCfg) if (name.str() == hmdDeviceCfg)
deviceInfo = &(*it); deviceInfo = &(*it);
if (hmdDeviceId == it->Identifier) if (hmdDeviceId == it->Identifier)