00001 //------------------------------------------------------------------------------ 00002 // Lamp : Open source game middleware 00003 // Copyright (C) 2004 Junpei Ohtani ( Email : junpee@users.sourceforge.jp ) 00004 // 00005 // This library is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU Lesser General Public 00007 // License as published by the Free Software Foundation; either 00008 // version 2.1 of the License, or (at your option) any later version. 00009 // 00010 // This library is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 // Lesser General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public 00016 // License along with this library; if not, write to the Free Software 00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 //------------------------------------------------------------------------------ 00019 00020 /** @file 00021 * FPS計測ヘッダ 00022 * @author Junpee 00023 */ 00024 00025 #ifndef FPS_MEASUREMENT_H_ 00026 #define FPS_MEASUREMENT_H_ 00027 00028 #include <Core/Utility/Timer.h> 00029 00030 namespace Lamp{ 00031 00032 //------------------------------------------------------------------------------ 00033 /** 00034 * FPS計測 00035 */ 00036 class FPSMeasurement{ 00037 public: 00038 /** 00039 * コンストラクタ 00040 */ 00041 FPSMeasurement(); 00042 00043 /** 00044 * デストラクタ 00045 */ 00046 virtual ~FPSMeasurement(); 00047 00048 /** 00049 * リセット 00050 */ 00051 virtual void reset(); 00052 00053 /** 00054 * 計測 00055 * @return FPS 00056 */ 00057 virtual float measurement(); 00058 00059 /** 00060 * FPSの取得 00061 * @return FPS 00062 */ 00063 virtual float getFPS(){ return fps_; } 00064 00065 //-------------------------------------------------------------------------- 00066 private: 00067 // コピーコンストラクタの隠蔽 00068 FPSMeasurement(const FPSMeasurement& copy); 00069 00070 // 代入コピーの隠蔽 00071 void operator =(const FPSMeasurement& copy); 00072 00073 // FPS 00074 float fps_; 00075 // 前回タイム 00076 Timer::Tick lastTime_; 00077 // フレーム数 00078 int frameCount_; 00079 }; 00080 00081 //------------------------------------------------------------------------------ 00082 } // End of namespace Lamp 00083 #endif // End of FPS_MEASUREMENT_H_ 00084 //------------------------------------------------------------------------------ 00085