DDFrameRate.h
资源名称:DXGuide.zip [点击查看]
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:1k
源码类别:
DirextX编程
开发平台:
Visual C++
- // Copyright (C) 1998-1999 DXGuide. All Rights Reserved.
- // File: DDFrameRate.h
- #ifndef _DDFRAMERATE__H
- #define _DDFRAMERATE__H
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
- class CDDSurface;
- class CDDDevice;
- class CDDTextSurface;
- class CDDFrameRate
- {
- friend class CDXGUIManager;
- protected:
- CDDFrameRate(void);
- ~CDDFrameRate();
- protected:
- bool Create(CDDDevice* pDDDevice,
- COLORREF clrText,
- int nX = 0, int nY = 0);
- public:
- void Reset(void); // Resets the counter.
- void Tick(void); // Increments the counter.
- // Returns the Rate (ticks per second). The Rate is only updated once per second.
- int GetRate(void) const;
- HRESULT Draw(CDDSurface* pDestSurface);
- protected:
- int m_nTPS; // Ticks per second as of last update.
- __int64 m_i64TimeLast; // Time of last update.
- UINT m_uiTick; // Number of ticks since last update.
- __int64 m_i64OneSecondSpan;
- protected:
- CDDTextSurface* m_pTextSurface;
- int m_nX;
- int m_nY;
- };
- #include "DDFrameRate.inl"
- #endif // _DDFRAMERATE__H