![]() |
Dragonfly 2.2
A text-based game engine
|
00001 // 00002 // Fraps.h 00003 // 00004 00005 #ifndef __FRAPS_H__ 00006 #define __FRAPS_H__ 00007 00008 #include "ViewObject.h" 00009 #include "Event.h" 00010 #include "Clock.h" 00011 00012 #define FRAPS_STRING "fps" 00013 00014 #define FRAPS_FILENAME "fraps" 00015 00016 class Fraps : public ViewObject { 00017 00018 protected: 00019 bool do_record; ///< true if recording 00020 Clock clock; ///< for computing frame rate 00021 FILE *screen_fp; ///< output file handle 00022 00023 public: 00024 /// Frames per second meter (with option to record screen) 00025 /// defaults: TOP_RIGHT, green, don't record 00026 Fraps(bool do_record=false); 00027 ~Fraps(); 00028 00029 /// Handle event each step, f9 to hide, f12 to toggle recording 00030 int eventHandler(Event *p_e); 00031 00032 /// Set whether record or not, opens new file if turn on 00033 void setRecord(bool new_record); 00034 bool getRecord(); 00035 }; 00036 00037 #endif