mrtimer.h

来自「Games programming all in one code chapte」· C头文件 代码 · 共 42 行

H
42
字号
 /* 'mrTimer.h' */

 /* Mirus base types header */
#include "mrDatatypes.h"
 /* Windows header file */
#include <windows.h> 
 /* Time header file */
#include <time.h> 

 /* Include this file only once */
#pragma once

 /* Mirus timer class */
class mrTimer
{
protected:
  /* Hardware timer variables */
 LARGE_INTEGER   m_iFrequency;
 LARGE_INTEGER   m_iLastQuery;
 LARGE_INTEGER   m_iDelta;

  /* Time and date variables */
 tm *            m_pkTime;

public:
  /* Constructor / Destructor */
 mrTimer (void);
 ~mrTimer (void);

  /* Update the time variables */
 void Update (void);

  /* Return the timer information */
 mrReal32 GetDelta (void);
 mrUInt32 GetSeconds (void);
 mrUInt32 GetMinutes (void);
 mrUInt32 GetHours (void);
 mrUInt32 GetDay (void);
 mrUInt32 GetMonth (void);
 mrUInt32 GetYear (void);
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?