Clock.h
Upload User: sz83729876
Upload Date: 2013-03-07
Package Size: 4140k
Code Size: 1k
Category:

OpenGL program

Development Platform:

Windows_Unix

  1. #ifndef _TIMER_H_
  2. #define _TIMER_H_
  3. #include <stdio.h>
  4. #include "Base.h"
  5. enum TIMER_TYPE { TIMER_APPSTART, TIMER_SINCEAPPSTART, 
  6.                   TIMER_SINCELASTFRAME, TIMER_ACTUAL };
  7. class Timer
  8. {
  9.     private:
  10.         static LARGE_INTEGER   m_llPerformanceFreq;
  11.         static LARGE_INTEGER   m_llBeginTime;
  12.         static LARGE_INTEGER   m_llLastTime;
  13.         static LARGE_INTEGER   m_llCurTime;
  14.         static float           m_fTimeScale;
  15.         static float           m_fBeginTime;
  16.         static float           m_fCurrentTime;
  17.         static float           m_fSecSinceLastFrame;
  18.         static float           m_fCounter;
  19.         static float           m_fFPS, m_fTempFPS;
  20.         static long            m_dwFrameCount;
  21.     public:
  22.         static float GetFPS();
  23.         static float GetTimer( TIMER_TYPE enumType );
  24.         static bool OncePerFrameQuery( HWND hWnd );
  25.         static bool Initialize();
  26. };
  27. #endif