⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fps.h

📁 Introduction to directx9 3d game programming 一书的源代码
💻 H
字号:
//////////////////////////////////////////////////////////////////////////////////////////////////
// 
// File: fps.h
// 
// Author: Frank Luna (C) All Rights Reserved
//
// System: AMD Athlon 1800+ XP, 512 DDR, Geforce 3, Windows XP, MSVC++ 7.0 
//
// Desc: Wraps the code to compute and display the frames rendered per second.
//          
//////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef __fpsH__
#define __fpsH__

#include "d3dfont.h"

class FPSCounter
{
public:
	FPSCounter(IDirect3DDevice9* device);
	~FPSCounter();

	bool render(D3DCOLOR color, float timeDelta);
private:
	IDirect3DDevice9* _device;
	
	CD3DFont* _font;
	DWORD     _frameCnt;
	float     _timeElapsed;
	float     _fps;
	char      _fpsString[9];
	
};
#endif // __fpsH__

⌨️ 快捷键说明

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