fix initialization bug; add minor interfaces

This commit is contained in:
David Rose 2005-09-07 00:05:24 +00:00
parent 8f06d9e0d3
commit 4b58cb8500
3 changed files with 17 additions and 0 deletions

View File

@ -101,6 +101,7 @@ get_text_pattern() const {
INLINE void FrameRateMeter::
set_clock_object(ClockObject *clock_object) {
_clock_object = clock_object;
_last_update = 0.0f;
}
////////////////////////////////////////////////////////////////////
@ -113,3 +114,16 @@ INLINE ClockObject *FrameRateMeter::
get_clock_object() const {
return _clock_object;
}
////////////////////////////////////////////////////////////////////
// Function: FrameRateMeter::update
// Access: Published
// Description: You can call this to explicitly force the
// FrameRateMeter to update itself with the latest frame
// rate information. Normally, it is not necessary to
// call this explicitly.
////////////////////////////////////////////////////////////////////
INLINE void FrameRateMeter::
update() {
do_update();
}

View File

@ -39,6 +39,7 @@ TypeHandle FrameRateMeter::_type_handle;
FrameRateMeter::
FrameRateMeter(const string &name) : TextNode(name) {
_update_interval = frame_rate_meter_update_interval;
_last_update = 0.0f;
_text_pattern = frame_rate_meter_text_pattern;
_clock_object = ClockObject::get_global_clock();

View File

@ -62,6 +62,8 @@ PUBLISHED:
INLINE void set_clock_object(ClockObject *clock_object);
INLINE ClockObject *get_clock_object() const;
INLINE void update();
protected:
virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data);