14#ifndef FRAMERATEMETER_H
15#define FRAMERATEMETER_H
37class EXPCL_PANDA_GRUTIL FrameRateMeter :
public TextNode {
39 explicit FrameRateMeter(
const std::string &name);
40 virtual ~FrameRateMeter();
63 void do_update(
Thread *current_thread);
70 bool _show_milliseconds;
71 double _update_interval;
73 std::string _text_pattern;
76 PN_stdfloat _last_aspect_ratio;
85 static void init_type() {
86 TextNode::init_type();
88 TextNode::get_class_type());
91 return get_class_type();
93 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
A ClockObject keeps track of elapsed real time and discrete time.
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
A rectangular subregion within a window for rendering into.
void set_clock_object(ClockObject *clock_object)
Sets the clock that is used to determine the frame rate.
DisplayRegion * get_display_region() const
Returns the DisplayRegion that the meter has created to render itself into the window to setup_window...
const std::string & get_text_pattern() const
Returns the sprintf() pattern that is used to format the text.
double get_update_interval() const
Returns the number of seconds that will elapse between updates to the frame rate indication.
void set_text_pattern(const std::string &text_pattern)
Sets the sprintf() pattern that is used to format the text.
void set_update_interval(double update_interval)
Specifies the number of seconds that should elapse between updates to the frame rate indication.
ClockObject * get_clock_object() const
Returns the clock that is used to determine the frame rate.
void setup_window(GraphicsOutput *window)
Sets up the frame rate meter to create a DisplayRegion to render itself into the indicated window.
GraphicsOutput * get_window() const
Returns the GraphicsOutput that was passed to setup_window(), or NULL if setup_window() has not been ...
void clear_window()
Undoes the effect of a previous call to setup_window().
This is a base class for the various different classes that represent the result of a frame of render...
A lightweight class that represents a single element that may be timed and/or counted via stats.
void update()
Can be called after the TextNode has been fully configured, to force the node to recompute its text i...
virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data)
This function will be called during the cull traversal to perform any additional operations that shou...
A thread; that is, a lightweight process.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.