diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-29 12:40:45 +0100 | 
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-29 12:40:45 +0100 | 
| commit | 28a39e38963dd85db1a8eda3edffbeb302ef4d3d (patch) | |
| tree | eee7822e6466f8d95065e96b870de17c9e7f8a2c | |
| parent | 10c826c917707025c709bca237709f77ecbea6c7 (diff) | |
rift-080: forgot ovr_Initialize()
| -rw-r--r-- | ftnoir_tracker_rift_080/ftnoir_tracker_rift_080.cpp | 22 | 
1 files 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) | 
