mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:09:24 +02:00
don't initialize SMI sdk unless we need it
This commit is contained in:
parent
cdd150f24e
commit
310a5c9bfb
1 changed files with 18 additions and 12 deletions
|
@ -118,18 +118,6 @@ void EyeTracker::init() {
|
||||||
qCWarning(interfaceapp) << "Eye Tracker: Already initialized";
|
qCWarning(interfaceapp) << "Eye Tracker: Already initialized";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_IVIEWHMD
|
|
||||||
int result = smi_setCallback(eyeTrackerCallback);
|
|
||||||
if (result != SMI_RET_SUCCESS) {
|
|
||||||
qCWarning(interfaceapp) << "Eye Tracker: Error setting callback:" << smiReturnValueToString(result);
|
|
||||||
QMessageBox::warning(nullptr, "Eye Tracker Error", smiReturnValueToString(result));
|
|
||||||
} else {
|
|
||||||
_isInitialized = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
connect(&_startStreamingWatcher, SIGNAL(finished()), this, SLOT(onStreamStarted()));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_IVIEWHMD
|
#ifdef HAVE_IVIEWHMD
|
||||||
|
@ -140,6 +128,10 @@ int EyeTracker::startStreaming(bool simulate) {
|
||||||
|
|
||||||
#ifdef HAVE_IVIEWHMD
|
#ifdef HAVE_IVIEWHMD
|
||||||
void EyeTracker::onStreamStarted() {
|
void EyeTracker::onStreamStarted() {
|
||||||
|
if (!_isInitialized) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int result = _startStreamingWatcher.result();
|
int result = _startStreamingWatcher.result();
|
||||||
_isStreaming = (result == SMI_RET_SUCCESS);
|
_isStreaming = (result == SMI_RET_SUCCESS);
|
||||||
|
|
||||||
|
@ -171,6 +163,20 @@ void EyeTracker::onStreamStarted() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void EyeTracker::setEnabled(bool enabled, bool simulate) {
|
void EyeTracker::setEnabled(bool enabled, bool simulate) {
|
||||||
|
if (enabled && !_isInitialized) {
|
||||||
|
#ifdef HAVE_IVIEWHMD
|
||||||
|
int result = smi_setCallback(eyeTrackerCallback);
|
||||||
|
if (result != SMI_RET_SUCCESS) {
|
||||||
|
qCWarning(interfaceapp) << "Eye Tracker: Error setting callback:" << smiReturnValueToString(result);
|
||||||
|
QMessageBox::warning(nullptr, "Eye Tracker Error", smiReturnValueToString(result));
|
||||||
|
} else {
|
||||||
|
_isInitialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
connect(&_startStreamingWatcher, SIGNAL(finished()), this, SLOT(onStreamStarted()));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
if (!_isInitialized) {
|
if (!_isInitialized) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue