define sync_frame_time

This commit is contained in:
David Rose 2003-03-25 23:33:44 +00:00
parent 222845f50b
commit aee3bf8fae
2 changed files with 22 additions and 0 deletions

View File

@ -136,6 +136,27 @@ tick() {
_frame_count++;
}
////////////////////////////////////////////////////////////////////
// Function: ClockObject::sync_frame_time
// Access: Published
// Description: Resets the frame time to the current real time. This
// is similar to tick(), except that it does not advance
// the frame counter and does not affect dt. This is
// intended to be used in the middle of a particularly
// long frame to compensate for the time that has
// already elapsed.
//
// In non-real-time mode, this function has no effect
// (because in this mode all frames take the same length
// of time).
////////////////////////////////////////////////////////////////////
void ClockObject::
sync_frame_time() {
if (_mode == M_normal) {
_reported_frame_time = get_real_time();
}
}
////////////////////////////////////////////////////////////////////
// Function: get_time_of_day
// Description:

View File

@ -95,6 +95,7 @@ PUBLISHED:
INLINE void set_max_dt(double max_dt);
void tick();
void sync_frame_time();
INLINE static ClockObject *get_global_clock();