From 8f654b8f244c9eac2049d7b591b8e1e3c106ccbf Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sat, 26 Jul 2014 09:15:47 +0900 Subject: [PATCH] add function to set ecore loop time @feature this allows you to set the ecore loop time. only useful in trying to get hyper-accurate frame timings from sources when doin a custom tick source. --- src/lib/ecore/Ecore_Common.h | 22 ++++++++++++++++++++++ src/lib/ecore/ecore_time.c | 6 ++++++ 2 files changed, 28 insertions(+) diff --git a/src/lib/ecore/Ecore_Common.h b/src/lib/ecore/Ecore_Common.h index 2fad5c1988..e41ec5eb68 100644 --- a/src/lib/ecore/Ecore_Common.h +++ b/src/lib/ecore/Ecore_Common.h @@ -983,6 +983,28 @@ EAPI double ecore_time_get(void); EAPI double ecore_time_unix_get(void); EAPI double ecore_loop_time_get(void); +/** + * Set the loop time + * + * @param t The new loop time + * + * You should never need/call this, unless you are implementing a custom + * tick source for an ecore animator. Only then inside your function that + * calls ecore_animator_custom_tick(), just before it, if you are able to + * get accurate timing information as to when the source of your tick + * woke up, use this to adjust the ecore loop time to be perfectly + * accurate. It is not a requirement, but makes things smoother. You should + * not use it otherwise as it could harm timeline handling throughout the + * application. Also note that the time point must match whatever zero time + * you get from ecore_time_get() and ecore_loop_time_get() (same 0 point). + * What this point is is undefined, sou unless your source uses the same + * 0 time, then you may have to adjust and do some guessing. + * + * @see ecore_animator_custom_tick() + * @see ecore_loop_time_get() + */ +EAPI void ecore_loop_time_set(double t); + /** * @} */ diff --git a/src/lib/ecore/ecore_time.c b/src/lib/ecore/ecore_time.c index 79dff91876..d2ac8c4e33 100644 --- a/src/lib/ecore/ecore_time.c +++ b/src/lib/ecore/ecore_time.c @@ -120,6 +120,12 @@ ecore_loop_time_get(void) return _ecore_time_loop_time; } +EAPI void +ecore_loop_time_set(double t) +{ + _ecore_time_loop_time = t; +} + /** * @} */