|
|
/*************************************************************************** vim:tabstop=4 CFps.h - description ------------------- begin : Sun Jul 1 2001 copyright : (C) 2001 by Francois Biot email : fbiot@free.fr ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef _CFps_h_ #define _CFps_h_ #include#if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif class CFps { public: CFps(unsigned long lEchantillonnage=1000); operator float(); long operator ++(int) { return mlCurrentFrames++; } bool IsChanged() { operator float(); return mbIsChanged; } float MeanFps(); long LastFrames() { return mlLastFrames; } unsigned long Ticks(struct timeval&) const; unsigned long EllapsedUs(bool bReset=false); private: void Reset(); long mlFrames; long mlLastFrames; long mlCurrentFrames; struct timeval mt; float mfLastFps; unsigned long mlLastTicks; long mlInitsec; unsigned long mlEch; bool mbIsChanged; }; #endif
Generated by: saturn on FrancoisLinux on Sun Feb 3 20:01:44 2002, using kdoc 2.0a53. |