home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / XenonSource.exe / gamesystem / includes / gs_framecounter.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-11  |  898 b   |  47 lines

  1. //-------------------------------------------------------------
  2. //
  3. // Class:    gsCFrameCounter
  4. //
  5. // Author:    John M Phillips
  6. //
  7. // Started:    12/03/00
  8. //
  9. // Base:    gsCObject
  10. //
  11. // Derived:    None
  12. //
  13. //-------------------------------------------------------------
  14.  
  15. #ifndef _INCLUDE_GS_FRAMECOUNTER_H
  16. #define _INCLUDE_GS_FRAMECOUNTER_H
  17.  
  18. #include "gs_timer.h"
  19.  
  20. //-------------------------------------------------------------
  21.  
  22. const int gsFRAMECOUNTER_SAMPLES = 100;
  23.  
  24. //-------------------------------------------------------------
  25.  
  26. class gsCFrameCounter : public gsCObject
  27. {
  28.     private:
  29.         gsCTimer m_timer;
  30.         int m_sample_index;
  31.         float m_samples[gsFRAMECOUNTER_SAMPLES];
  32.  
  33.     public:
  34.         gsCFrameCounter();
  35.         ~gsCFrameCounter();
  36.  
  37.         void reset();
  38.         void markFrame();
  39.  
  40.         float getFrameRate();
  41. };
  42.  
  43. //-------------------------------------------------------------
  44.  
  45. #endif
  46.  
  47.