summaryrefslogtreecommitdiffhomepage
path: root/tracker-steamvr
diff options
context:
space:
mode:
Diffstat (limited to 'tracker-steamvr')
-rw-r--r--tracker-steamvr/steamvr.cpp15
-rw-r--r--tracker-steamvr/steamvr.hpp2
2 files changed, 11 insertions, 6 deletions
diff --git a/tracker-steamvr/steamvr.cpp b/tracker-steamvr/steamvr.cpp
index 4c40d1a1..ff48ad3d 100644
--- a/tracker-steamvr/steamvr.cpp
+++ b/tracker-steamvr/steamvr.cpp
@@ -170,14 +170,19 @@ tt device_list::vr_init_()
QString device_list::error_string(vr_error_t err)
{
- const char* str(vr::VR_GetVRInitErrorAsSymbol(err));
- return QString(str ? str : "No description");
-}
+ const char* str = vr::VR_GetVRInitErrorAsSymbol(err);
+ const char* desc = vr::VR_GetVRInitErrorAsEnglishDescription(err);
-steamvr::steamvr() : device_index(-1)
-{
+ if (!desc)
+ desc = "No description";
+
+ if (str)
+ return QStringLiteral("%1: %2").arg(str, desc);
+ else
+ return { "Unknown error" };
}
+steamvr::steamvr() = default;
steamvr::~steamvr() = default;
module_status steamvr::start_tracker(QFrame*)
diff --git a/tracker-steamvr/steamvr.hpp b/tracker-steamvr/steamvr.hpp
index 1a16f002..88fa740a 100644
--- a/tracker-steamvr/steamvr.hpp
+++ b/tracker-steamvr/steamvr.hpp
@@ -76,7 +76,7 @@ class steamvr : public QObject, public ITracker
static void matrix_to_euler(double& yaw, double& pitch, double& roll, const vr::HmdMatrix34_t& result);
settings s;
- int device_index;
+ unsigned device_index{UINT_MAX};
public:
steamvr();