aboutsummaryrefslogtreecommitdiff
path: root/src/survive.c
diff options
context:
space:
mode:
authorMike Turvey <mturvey6@gmail.com>2018-01-05 03:54:29 -0700
committerMike Turvey <mturvey6@gmail.com>2018-01-05 03:54:29 -0700
commit735a8bd11070b0c563e891ff8b70ce297a52a367 (patch)
tree0907027c98ca28d2e13f1e66edd38135119946d5 /src/survive.c
parent499b80ae7b538f8e66f5ec8bfa60c7136a3babf5 (diff)
downloadlibsurvive-735a8bd11070b0c563e891ff8b70ce297a52a367.tar.gz
libsurvive-735a8bd11070b0c563e891ff8b70ce297a52a367.tar.bz2
Add standard output mechanism for posers
Added a raw pose output/ callback that the posers can call when they have calculated a pose.
Diffstat (limited to 'src/survive.c')
-rwxr-xr-xsrc/survive.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/survive.c b/src/survive.c
index 75c07bf..1c406e8 100755
--- a/src/survive.c
+++ b/src/survive.c
@@ -184,6 +184,7 @@ SurviveContext * survive_init( int headless )
// start the thread to process button data
ctx->buttonservicethread = OGCreateThread(button_servicer, ctx);
survive_install_button_fn(ctx, NULL);
+ survive_install_raw_pose_fn(ctx, NULL);
return ctx;
}
@@ -235,9 +236,15 @@ void survive_install_button_fn(SurviveContext * ctx, button_process_func fbp)
ctx->buttonproc = fbp;
else
ctx->buttonproc = survive_default_button_process;
-
}
+void survive_install_raw_pose_fn(SurviveContext * ctx, raw_pose_func fbp)
+{
+ if (fbp)
+ ctx->rawposeproc = fbp;
+ else
+ ctx->rawposeproc = survive_default_raw_pose_process;
+}
int survive_add_object( SurviveContext * ctx, SurviveObject * obj )
{
int oldct = ctx->objs_ct;