diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-10 10:36:50 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-10 10:42:04 +0200 |
commit | 9ca25ef8d49098bba3ab821ea84ef51843a74933 (patch) | |
tree | 967334373fffd509c88a82a58ec4e14d42d09549 /tracker-rift-080/ftnoir_tracker_rift_080.cpp | |
parent | 5889b83298ca22dde8d374a701eed3eddd3e28de (diff) |
tracker/rift-080: output more debug data
Diffstat (limited to 'tracker-rift-080/ftnoir_tracker_rift_080.cpp')
-rw-r--r-- | tracker-rift-080/ftnoir_tracker_rift_080.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tracker-rift-080/ftnoir_tracker_rift_080.cpp b/tracker-rift-080/ftnoir_tracker_rift_080.cpp index 3b8b8752..d3019ac5 100644 --- a/tracker-rift-080/ftnoir_tracker_rift_080.cpp +++ b/tracker-rift-080/ftnoir_tracker_rift_080.cpp @@ -22,21 +22,30 @@ Rift_Tracker::~Rift_Tracker() void Rift_Tracker::start_tracker(QFrame*) { - if (!OVR_SUCCESS(ovr_Initialize(nullptr))) + QString reason; + ovrResult code; + + if (!OVR_SUCCESS(code = ovr_Initialize(nullptr))) + { + reason = "initialize failed"; goto error; + } { ovrGraphicsLuid luid = {0}; ovrResult res = ovr_Create(&hmd, &luid); - if (OVR_SUCCESS(res)) + if (OVR_SUCCESS(code = res)) { ovr_ConfigureTracking(hmd, ovrTrackingCap_Orientation | ovrTrackingCap_MagYawCorrection | ovrTrackingCap_Position, ovrTrackingCap_Orientation); } else + { + reason = "can't open hmd"; goto error; + } } return; error: - QMessageBox::warning(0,"Error", "Unable to start Rift tracker",QMessageBox::Ok,QMessageBox::NoButton); + QMessageBox::warning(0,"Error", QString("Unable to start Rift tracker: %1 (%2)").arg(reason, code), QMessageBox::Ok,QMessageBox::NoButton); } void Rift_Tracker::data(double *data) |