diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2013-10-30 17:22:02 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2013-10-30 17:22:34 +0100 |
commit | 2af0ddbcf5cf32e4f6e8e1e3993a1aca0c409c90 (patch) | |
tree | b32c4bfbfdeafcdcad72e383edbb04b8f8ada797 /opentrack-api/trackers.cpp | |
parent | ea2660dd167a853e704f167410037da162eccc6f (diff) |
add initial, untested opentrack-api.dll
Signed-off-by: Stanislaw Halik <sthalik@misaki.pl>
Diffstat (limited to 'opentrack-api/trackers.cpp')
-rw-r--r-- | opentrack-api/trackers.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/opentrack-api/trackers.cpp b/opentrack-api/trackers.cpp new file mode 100644 index 00000000..2527017b --- /dev/null +++ b/opentrack-api/trackers.cpp @@ -0,0 +1,38 @@ +#include "opentrack-guts.h" +#include "opentrack.h" + +extern "C" { + +opentrack_tracker OPENTRACK_EXPORT opentrack_make_tracker(opentrack ctx, const char* name) +{ + QString n(name); + for (int i = 0; i < ctx->meta_list.size(); i++) + { + auto meta = ctx->meta_list[i]; + if (ctx->meta_list.at(i).path == name) + { + ITracker* foo = reinterpret_cast<ITracker*>(meta.lib->Constructor()); + return foo; + } + } + return NULL; +} + +void OPENTRACK_EXPORT opentrack_finalize_tracker(opentrack_tracker tracker) +{ + delete tracker; +} + +void OPENTRACK_EXPORT opentrack_tracker_start(opentrack self, opentrack_tracker tracker) +{ + // hot damn, this is problematic! + // need to pass QFrame from somewhere + return tracker->StartTracker(&self->fake_frame); +} + +int OPENTRACK_EXPORT opentrack_tracker_tick(opentrack_tracker tracker, double* headpose) +{ + return tracker->GiveHeadPoseData(headpose); +} + +} |