Skip to content

Commit

Permalink
polling example update
Browse files Browse the repository at this point in the history
  • Loading branch information
thecaptury committed Jul 1, 2024
1 parent db1ba9c commit b7a1c7f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/polling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ int main(int argc, char** argv)
// Additional flags should be added as required.
Captury_startStreaming(CAPTURY_STREAM_POSES | CAPTURY_STREAM_COMPRESSED);

uint64_t lastTimestamp = 0;
while (true) {
// get list of actors - otherwise we won't know whom to poll
const CapturyActor* actors;
Expand All @@ -31,7 +32,10 @@ int main(int argc, char** argv)
if (pose == NULL)
continue;


if (pose->timestamp != lastTimestamp) {
Captury_log(CAPTURY_LOG_INFO, "actor %x has new pose at %zd\n", pose->actor, pose->timestamp);
lastTimestamp = pose->timestamp;
}

// make sure to free the pose using the provided function - potential binary incompatibilities between different Microsoft compilers
Captury_freePose(pose);
Expand Down

0 comments on commit b7a1c7f

Please sign in to comment.