//------------------------------------------------------------------------------
// Lamp : Open source game middleware
// Copyright (C) 2004  Junpei Ohtani ( Email : junpee@users.sourceforge.jp )
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//------------------------------------------------------------------------------

/** @file
 * FPS計測ヘッダ
 * @author Junpee
 */

#ifndef FPS_MEASUREMENT_H_
#define FPS_MEASUREMENT_H_

#include <Core/Utility/Timer.h>

namespace Lamp{

//------------------------------------------------------------------------------
/**
 * FPS計測
 */
class FPSMeasurement{
public:
	/**
	 * コンストラクタ
	 */
	FPSMeasurement();

	/**
	 * デストラクタ
	 */
	virtual ~FPSMeasurement();

	/**
	 * リセット
	 */
	virtual void reset();

	/**
	 * 計測
	 * @return FPS
	 */
	virtual float measurement();

	/**
	 * FPSの取得
	 * @return FPS
	 */
	virtual float getFPS(){ return fps_; }

	//--------------------------------------------------------------------------
private:
	// コピーコンストラクタの隠蔽
	FPSMeasurement(const FPSMeasurement& copy);

	// 代入コピーの隠蔽
	void operator =(const FPSMeasurement& copy);

	// FPS
	float fps_;
	// 前回タイム
	Timer::Tick lastTime_;
	// フレーム数
	int frameCount_;
};

//------------------------------------------------------------------------------
} // End of namespace Lamp
#endif // End of FPS_MEASUREMENT_H_
//------------------------------------------------------------------------------

