timer.h
来自「wince 3d tutorial, it has various exampl」· C头文件 代码 · 共 24 行
H
24 行
#ifndef TIMER_H
#define TIMER_H
#include <windows.h>
//Timer class, to control the FPS and the animations speed
class Timer
{
public:
Timer();
void UpdateTimer(); //This method updates the timer. May be called once in all frames
unsigned long GetTimeBetweenTwoFrames() {return m_diffTime;}; //returns the elapsed time between the current frame and the last frame
unsigned long GetTotalTime() {return m_accumTime;}; // return the time elapsed since the creation of the timer
int GetFPS() {return m_fps;}; // returns the frames per second
private:
unsigned long m_diffTime;
unsigned long m_accumTime;
unsigned long m_lastTime;
unsigned long m_frameTime;
int m_fps;
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?