diff options
-rw-r--r-- | ftnoir_protocol_sc/ftnoir_protocol_sc.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp index 1735305c..eb8d1a79 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp @@ -44,22 +44,24 @@ void FTNoIR_Protocol::run() { Affinity thr; - if (!SUCCEEDED(simconnect_open(&hSimConnect, "FaceTrackNoIR", NULL, 0, 0, 0))) - return; + while (!should_stop) + { + if (SUCCEEDED(simconnect_open(&hSimConnect, "opentrack", NULL, 0, 0, 0))) + { + simconnect_subscribetosystemevent(hSimConnect, 0, "Frame"); - simconnect_subscribetosystemevent(hSimConnect, EVENT_PING, "Frame"); + while (!should_stop) + { + if (FAILED(simconnect_calldispatch(hSimConnect, processNextSimconnectEvent, reinterpret_cast<void*>(this)))) + break; + Sleep(1); + } - //simconnect_mapclienteventtosimevent(hSimConnect, EVENT_INIT, ""); - //simconnect_addclienteventtonotificationgroup(hSimConnect, GROUP0, EVENT_INIT, false); - //simconnect_setnotificationgrouppriority(hSimConnect, GROUP0, SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE); + (void) simconnect_close(hSimConnect); + } - while (!should_stop) - { - (void) (simconnect_calldispatch(hSimConnect, processNextSimconnectEvent, reinterpret_cast<void*>(this))); - Sleep(1); + Sleep(100); } - - (void) simconnect_close(hSimConnect); } void FTNoIR_Protocol::pose( const double *headpose ) { |