summaryrefslogtreecommitdiffhomepage
path: root/opentrack-api/opentrack.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-10-30 17:22:02 +0100
committerStanislaw Halik <sthalik@misaki.pl>2013-10-30 17:22:34 +0100
commit2af0ddbcf5cf32e4f6e8e1e3993a1aca0c409c90 (patch)
treeb32c4bfbfdeafcdcad72e383edbb04b8f8ada797 /opentrack-api/opentrack.h
parentea2660dd167a853e704f167410037da162eccc6f (diff)
add initial, untested opentrack-api.dll
Signed-off-by: Stanislaw Halik <sthalik@misaki.pl>
Diffstat (limited to 'opentrack-api/opentrack.h')
-rw-r--r--opentrack-api/opentrack.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/opentrack-api/opentrack.h b/opentrack-api/opentrack.h
new file mode 100644
index 00000000..afd5506b
--- /dev/null
+++ b/opentrack-api/opentrack.h
@@ -0,0 +1,57 @@
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifndef IN_OPENTRACK
+ /* opaque pointers, forward definitions */
+ struct opentrack_opaque_ctx;
+ typedef opentrack_opaque_ctx* opentrack;
+ struct opentrack_opaque_tracker;
+ typedef opentrack_opaque_tracker* opentrack_tracker;
+#endif
+
+#ifdef IN_OPENTRACK
+# ifdef _WIN32
+# define OPENTRACK_EXPORT __declspec(dllexport)
+# else
+# define OPENTRACK_EXPORT
+# endif
+#else
+# ifdef _WIN32
+# define OPENTRACK_EXPORT __declspec(dllimport)
+# else
+# define OPENTRACK_EXPORT
+# endif
+#endif
+
+ /* for `opentrack_tracker_tick', individual headpose elts */
+#ifndef IN_OPENTRACK
+ enum opentrack_dof {
+ TX = 0,
+ TY,
+ TZ,
+ Yaw,
+ Pitch,
+ Roll,
+ DOF_count
+ };
+#endif
+
+ opentrack opentrack_make_ctx(const char* dir);
+ void opentrack_finalize_ctx(opentrack self);
+
+ /* no need to free the return value; invalid to modify it */
+ const char** opentrack_enum_trackers(opentrack self);
+
+ /*
+ * don't `opentrack_tracker_tick an unstarted tracker, it's invalid to do so
+ * it's also invalid to start a finalized tracker
+ */
+ opentrack_tracker opentrack_make_tracker(opentrack ctx, const char* name);
+ void opentrack_tracker_start(opentrack self, opentrack_tracker tracker);
+ int opentrack_tracker_tick(opentrack_tracker tracker, double* headpose);
+ void opentrack_finalize_tracker(opentrack_tracker tracker);
+#ifdef __cplusplus
+}
+#endif