34 INLINE ulong get_sec()
const;
35 INLINE ulong get_usec()
const;
75 void set_mode(Mode mode);
76 INLINE Mode get_mode()
const;
77 MAKE_PROPERTY(mode, get_mode, set_mode);
79 INLINE
double get_frame_time(
Thread *current_thread = Thread::get_current_thread())
const;
80 INLINE
double get_real_time()
const;
81 INLINE
double get_long_time()
const;
84 void set_real_time(
double time);
85 void set_frame_time(
double time,
Thread *current_thread = Thread::get_current_thread());
86 void set_frame_count(
int frame_count,
Thread *current_thread = Thread::get_current_thread());
88 INLINE
int get_frame_count(
Thread *current_thread = Thread::get_current_thread())
const;
89 INLINE
double get_net_frame_rate(
Thread *current_thread = Thread::get_current_thread())
const;
91 MAKE_PROPERTY(frame_time, get_frame_time, set_frame_time);
92 MAKE_PROPERTY(real_time, get_real_time, set_real_time);
93 MAKE_PROPERTY(long_time, get_long_time);
94 MAKE_PROPERTY(frame_count, get_frame_count, set_frame_count);
96 INLINE
double get_dt(
Thread *current_thread = Thread::get_current_thread())
const;
97 void set_dt(
double dt);
98 void set_frame_rate(
double frame_rate);
99 MAKE_PROPERTY(dt, get_dt, set_dt);
101 INLINE
double get_max_dt()
const;
102 INLINE
void set_max_dt(
double max_dt);
103 MAKE_PROPERTY(max_dt, get_max_dt, set_max_dt);
105 INLINE
double get_degrade_factor()
const;
106 INLINE
void set_degrade_factor(
double degrade_factor);
107 MAKE_PROPERTY(degrade_factor, get_degrade_factor, set_degrade_factor);
109 INLINE
void set_average_frame_rate_interval(
double time);
110 INLINE
double get_average_frame_rate_interval()
const;
111 MAKE_PROPERTY(average_frame_rate_interval,
112 get_average_frame_rate_interval,
113 set_average_frame_rate_interval);
115 double get_average_frame_rate(
Thread *current_thread = Thread::get_current_thread())
const;
116 double get_max_frame_duration(
Thread *current_thread = Thread::get_current_thread())
const;
117 double calc_frame_rate_deviation(
Thread *current_thread = Thread::get_current_thread())
const;
118 MAKE_PROPERTY(average_frame_rate, get_average_frame_rate);
119 MAKE_PROPERTY(max_frame_duration, get_max_frame_duration);
121 void tick(
Thread *current_thread = Thread::get_current_thread());
122 void sync_frame_time(
Thread *current_thread = Thread::get_current_thread());
124 INLINE
bool check_errors(
Thread *current_thread);
129 static void (*_start_clock_wait)();
130 static void (*_start_clock_busy_wait)();
131 static void (*_stop_clock_wait)();
134 void wait_until(
double want_time);
135 static void make_global_clock();
136 static void dummy_clock_wait();
140 double _start_short_time;
141 double _start_long_time;
142 double _actual_frame_time;
144 double _user_frame_rate;
145 double _degrade_factor;
149 double _average_frame_rate_interval;
154 class EXPCL_PANDA_PUTIL CData :
public CycleData {
157 INLINE CData(
const CData ©);
161 return ClockObject::get_class_type();
165 double _reported_frame_time;
166 double _reported_frame_time_epoch;
175 static AtomicAdjust::Pointer _global_clock;
181 static void init_type() {
182 ReferenceCount::init_type();
184 ReferenceCount::get_class_type());
191 EXPCL_PANDA_PUTIL std::ostream &
192 operator << (std::ostream &out, ClockObject::Mode mode);
193 EXPCL_PANDA_PUTIL std::istream &
194 operator >> (std::istream &in, ClockObject::Mode &mode);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A single page of data maintained by a PipelineCycler.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual TypeHandle get_parent_type() const
Returns the type of the container that owns the CycleData.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This template class calls PipelineCycler::read_unlocked(), and then provides a transparent read-only ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A ClockObject keeps track of elapsed real time and discrete time.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This template class calls PipelineCycler::write() in the constructor and PipelineCycler::release_writ...
An interface to whatever real-time clock we might have available in the current environment.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class is similar to CycleDataReader, except it allows reading from a particular stage of the pip...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for all things that want to be reference-counted.
A thread; that is, a lightweight process.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.