00001 #ifndef FPS_H_IS_INCLUDED 00002 #define FPS_H_IS_INCLUDED 00003 00004 #include "std/stop_watch.H" 00005 #include "disp/gel.H" 00006 #include "geom/text2d.H" 00007 00008 /***************************************************************** 00009 * FPS: 00010 * 00011 * Displays frames per second in lower left of window. 00012 *****************************************************************/ 00013 MAKE_PTR_SUBC(FPS, FRAMEobs); 00014 class FPS : public FRAMEobs { 00015 public: 00016 00017 //******** MANAGERS ******** 00018 FPS(); 00019 00020 //******** FRAMEobs VIRTUAL METHODS ******** 00021 int tick(void); 00022 00023 protected: 00024 TEXT2Dptr _text; // text that is displayed 00025 unsigned int _last_display; // VIEW::stamp() when last updated 00026 stop_watch _clock; // clock measuring time since update 00027 }; 00028 00029 #endif // FPS_H_IS_INCLUDED