From 28a39e38963dd85db1a8eda3edffbeb302ef4d3d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 29 Oct 2015 12:40:45 +0100 Subject: rift-080: forgot ovr_Initialize() --- .../ftnoir_tracker_rift_080.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/ftnoir_tracker_rift_080/ftnoir_tracker_rift_080.cpp b/ftnoir_tracker_rift_080/ftnoir_tracker_rift_080.cpp index 5495e0e3..889ac8c3 100644 --- a/ftnoir_tracker_rift_080/ftnoir_tracker_rift_080.cpp +++ b/ftnoir_tracker_rift_080/ftnoir_tracker_rift_080.cpp @@ -21,18 +21,24 @@ Rift_Tracker::~Rift_Tracker() void Rift_Tracker::start_tracker(QFrame*) { - ovrGraphicsLuid luid; - ovrResult result = ovr_Create(&hmd, &luid); - if (OVR_SUCCESS(result)) { - ovr_ConfigureTracking(hmd, ovrTrackingCap_Orientation | ovrTrackingCap_MagYawCorrection | ovrTrackingCap_Position, ovrTrackingCap_Orientation); + ovrInitParams args = {0}; + if (!OVR_SUCCESS(ovr_Initialize(&args))) + goto error; } - else { - // XXX need change ITracker et al api to allow for failure reporting - // this qmessagebox doesn't give any relevant details either -sh 20141012 - QMessageBox::warning(0,"Error", "Unable to start Rift tracker",QMessageBox::Ok,QMessageBox::NoButton); + ovrGraphicsLuid luid = {0}; + ovrResult res = ovr_Create(&hmd, &luid); + if (OVR_SUCCESS(res)) + { + ovr_ConfigureTracking(hmd, ovrTrackingCap_Orientation | ovrTrackingCap_MagYawCorrection | ovrTrackingCap_Position, ovrTrackingCap_Orientation); + } + else + goto error; } + return; +error: + QMessageBox::warning(0,"Error", "Unable to start Rift tracker",QMessageBox::Ok,QMessageBox::NoButton); } void Rift_Tracker::data(double *data) -- cgit v1.2.3