aboutsummaryrefslogtreecommitdiff
path: root/api_example.c
diff options
context:
space:
mode:
authorJustin Berger <j.david.berger@gmail.com>2018-04-10 23:44:36 -0600
committerJustin Berger <j.david.berger@gmail.com>2018-04-10 23:44:36 -0600
commit30cfb87ec0d95e0cb8a671cf8f2327b4204927ed (patch)
tree6f35a37400ff9f341c17e6cf57da73bc5a260363 /api_example.c
parent0653df1da7364e75953eea85e92d23f2b41480be (diff)
downloadlibsurvive-30cfb87ec0d95e0cb8a671cf8f2327b4204927ed.tar.gz
libsurvive-30cfb87ec0d95e0cb8a671cf8f2327b4204927ed.tar.bz2
Renamed api; fixed various warnings
Diffstat (limited to 'api_example.c')
-rw-r--r--api_example.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/api_example.c b/api_example.c
index b0c9e4c..1f06740 100644
--- a/api_example.c
+++ b/api_example.c
@@ -4,31 +4,32 @@
#include <os_generic.h>
int main(int argc, char **argv) {
- SurviveAsyncContext *actx = survive_async_init(argc, argv);
+ SurviveSimpleContext *actx = survive_simple_init(argc, argv);
if (actx == 0) // implies -help or similiar
return 0;
- survive_async_start_thread(actx);
+ survive_simple_start_thread(actx);
- while (survive_async_is_running(actx)) {
+ while (survive_simple_is_running(actx)) {
OGUSleep(30000);
SurvivePose pose;
- for (const SurviveAsyncObject *it = survive_async_get_first_object(actx); it != 0;
- it = survive_async_get_next_object(actx, it)) {
- uint32_t timecode = survive_async_object_get_latest_pose(it, &pose);
- printf("%s (%u): %f %f %f %f %f %f %f\n", survive_async_object_name(it), timecode,
- pose.Pos[0], pose.Pos[1], pose.Pos[2], pose.Rot[0], pose.Rot[1], pose.Rot[2], pose.Rot[3]);
+ for (const SurviveSimpleObject *it = survive_simple_get_first_object(actx); it != 0;
+ it = survive_simple_get_next_object(actx, it)) {
+ uint32_t timecode = survive_simple_object_get_latest_pose(it, &pose);
+ printf("%s (%u): %f %f %f %f %f %f %f\n", survive_simple_object_name(it), timecode, pose.Pos[0],
+ pose.Pos[1], pose.Pos[2], pose.Rot[0], pose.Rot[1], pose.Rot[2], pose.Rot[3]);
}
OGUSleep(30000);
- for (const SurviveAsyncObject* it = survive_async_get_next_updated(actx); it != 0; it = survive_async_get_next_updated(actx)) {
- printf("%s changed since last checked\n", survive_async_object_name(it));
+ for (const SurviveSimpleObject *it = survive_simple_get_next_updated(actx); it != 0;
+ it = survive_simple_get_next_updated(actx)) {
+ printf("%s changed since last checked\n", survive_simple_object_name(it));
}
}
-
- survive_async_close(actx);
+
+ survive_simple_close(actx);
return 0;
}