00001 /*************************************************************************** 00002 * fps.h 00003 * 00004 * Wed Jan 14 18:59:41 2004 00005 * Copyright 2004 thierry schartz 00006 * thierry.schartz@bluebottle.com 00007 ****************************************************************************/ 00008 /* 00009 * This program is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU Library General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; if not, write to the Free Software 00021 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00022 */ 00023 #ifndef _FPS_H 00024 #define _FPS_H 00025 00026 #ifdef WIN32 00027 #include <windows.h> 00028 #endif 00029 00030 #include "build.h" 00031 00032 00033 00034 namespace ngn { 00035 namespace core { 00036 00037 00041 class NGN_API FPS 00042 { 00043 public: 00044 00045 FPS(); 00046 FPS( const FPS& other ); 00047 00049 void count(); 00051 double getFps()const; 00053 double getFrameInterval()const; 00054 00055 private: 00056 00057 double m_fps; 00058 double m_lasttime; 00059 double m_frametime; 00060 double m_frameinterval; 00061 double m_frameps; 00062 00063 }; 00064 00065 00066 00067 00068 }//core 00069 }//ngn 00070 00071 #endif /* _FPS_H */ 00072