?? m_time.h
字號:
////////////////////////////////
// M_TIME.H
// CLASS M_Time
// IN-GAME TIME SIGNAL GENERATOR
//
// PROJECT: Ultra Pac Man
// LAST UPDATE: Nov. 12th 2001
// PROGRAMER: Mal
////////////////////////////////
//USAGE: JUST AS ANY OF OUR SINGLE INSTANCE CLASSES, WE HAD
// PREPARED YOU A PRE-DEFINED GLOBAL POINTER. IN THIS
// CASE, IT'S thisTimer
//MILLISECOND RESOLUTION TIMER SOURCE FROM
// http://www.mhonline.net/~chuckh/software.html
#include "millisec.h"
#include "m_common.h"
#ifndef M_TIME
#define M_TIME
class M_Time
{
public:
M_Time();
void Reset(); //Reset in-game timer(frame counter)
long CreateSnapshot();
bool SetMaxFPS(float DesiredFPS);//Desired FPS can be a number between 1~1000
void FPSDelay();//auto FPS delay function
long GetFrameCounter();
float GetFPS();
float GetMaxFPS();
private:
long lFrameCounter;//Frame Counter, the in-game timer
long lCurTime;//Real time
float fMaxFPS;
float fFPS;//Actual FPS reports by function
float fFrameTime;//Calculated number,shows how long does a frame take
long lNextFrameTime;//Calculated next frame start time(Real time)
};
extern M_Time* thisTimer;
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -